diff --git a/main.c b/main.c index 3507509..2d4223c 100644 --- a/main.c +++ b/main.c @@ -34,7 +34,7 @@ #include #endif -__RCSID("$MirOS: src/bin/mksh/main.c,v 1.225 2012/07/01 15:38:06 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/main.c,v 1.226 2012/07/22 15:56:50 tg Exp $"); extern char **environ; @@ -844,6 +844,7 @@ shell(Source * volatile s, volatile bool toplevel) } /* return to closest error handler or shell(), exit if none found */ +/* note: i MUST NOT be 0 */ void unwind(int i) { diff --git a/sh.h b/sh.h index f6d79f7..3e6c8e8 100644 --- a/sh.h +++ b/sh.h @@ -157,7 +157,7 @@ #endif #ifdef EXTERN -__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.573 2012/07/20 23:22:13 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.574 2012/07/22 15:56:51 tg Exp $"); #endif #define MKSH_VERSION "R40 2012/07/21" @@ -631,6 +631,8 @@ enum sh_flag { /* * parsing & execution environment + * + * note that kshlongjmp MUST NOT be passed 0 as second argument! */ #ifdef MKSH_NO_SIGSETJMP #define kshjmp_buf jmp_buf @@ -676,6 +678,7 @@ extern struct env { #define STOP_RETURN(t) ((t) == E_FUNC || (t) == E_INCL) /* values for kshlongjmp(e->jbuf, i) */ +/* note that i MUST NOT be zero */ #define LRETURN 1 /* return statement */ #define LEXIT 2 /* exit statement */ #define LERROR 3 /* errorf() called */ @@ -1776,6 +1779,7 @@ int promptlen(const char *); int include(const char *, int, const char **, int); int command(const char *, int); int shell(Source * volatile, volatile bool); +/* argument MUST NOT be 0 */ void unwind(int) MKSH_A_NORETURN; void newenv(int); void quitenv(struct shf *);