add pic_blk_exit

This commit is contained in:
Yuichi Nishiwaki
2014-03-10 01:51:27 +09:00
parent 851187f7bb
commit 68ea22f6eb
2 changed files with 14 additions and 7 deletions
+2 -6
View File
@@ -7,6 +7,7 @@
#include "picrin.h"
#include "picrin/string.h"
#include "picrin/pair.h"
#include "picrin/cont.h"
static pic_value
pic_system_cmdline(pic_state *pic)
@@ -31,7 +32,6 @@ pic_system_exit(pic_state *pic)
{
pic_value v;
int argc, status = EXIT_SUCCESS;
pic_block *blk;
argc = pic_get_args(pic, "|o", &v);
if (argc == 1) {
@@ -47,11 +47,7 @@ pic_system_exit(pic_state *pic)
}
}
blk = pic->blk;
while (blk) {
pic_apply_argv(pic, blk->out, 0);
blk = blk->prev;
}
PIC_BLK_EXIT(pic);
exit(status);
}