diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/eval.c | 10 | ||||
-rw-r--r-- | src/eval.h | 10 |
3 files changed, 10 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog index 1830be2..ca56f81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ * Cleaned up src/Makefile.am. * Get rid of duplicate -g -O2 in CFLAGS. * Eliminate first null termination in setvar. + * Turn evalskip into a bit field. 2005-03-25 Gilles Chanteperdrix <gilles.chanteperdrix@laposte.net> diff --git a/src/eval.c b/src/eval.c index 7f00b21..793d4c9 100644 --- a/src/eval.c +++ b/src/eval.c @@ -324,8 +324,8 @@ out: dotrap(); if (flags & EV_EXIT) exraise(EXEXIT); - if ((checkexit & exitstatus) && evalskip != SKIPFILE) - evalskip = SKIPEVAL; + if ((checkexit & exitstatus)) + evalskip |= SKIPEVAL; } @@ -931,8 +931,7 @@ cmddone: commandname = savecmdname; exsig = 0; handler = savehandler; - if (evalskip == SKIPEVAL) - evalskip = 0; + evalskip &= ~SKIPEVAL; return i; } @@ -974,8 +973,7 @@ funcdone: shellparam = saveparam; handler = savehandler; INTON; - if (evalskip == SKIPFUNC) - evalskip = 0; + evalskip &= ~SKIPFUNC; return e; } diff --git a/src/eval.h b/src/eval.h index dc523e2..3d0a9a6 100644 --- a/src/eval.h +++ b/src/eval.h @@ -62,8 +62,8 @@ extern int funcnest; extern int evalskip; /* reasons for skipping commands (see comment on breakcmd routine) */ -#define SKIPBREAK 1 -#define SKIPCONT 2 -#define SKIPFUNC 3 -#define SKIPFILE 4 -#define SKIPEVAL 5 +#define SKIPBREAK (1 << 0) +#define SKIPCONT (1 << 1) +#define SKIPFUNC (1 << 2) +#define SKIPFILE (1 << 3) +#define SKIPEVAL (1 << 4) |