On Mon, Feb 28, 2005 at 09:01:28PM +1100, Herbert Xu wrote: > Please give this one a go and see if you can break it again :)
Didn't work this time ;-), this one does well in all my tests. See below for the patch against version 0.5.2 I plan to apply to the Debian package to fix this bug. Thanks, Gerrit.
Index: src/eval.c =================================================================== RCS file: /cvs/dash/src/eval.c,v retrieving revision 1.1 diff -u -r1.1 eval.c --- src/eval.c 3 Jul 2004 12:52:54 -0000 1.1 +++ src/eval.c 28 Feb 2005 15:34:09 -0000 @@ -322,8 +322,10 @@ out: if (pendingsigs) dotrap(); - if (flags & EV_EXIT || checkexit & exitstatus) + if (flags & EV_EXIT) exraise(EXEXIT); + if ((checkexit & exitstatus) && evalskip != SKIPFILE) + evalskip = SKIPEVAL; } @@ -929,6 +931,8 @@ commandname = savecmdname; exsig = 0; handler = savehandler; + if (evalskip == SKIPEVAL) + evalskip = 0; return i; } Index: src/eval.h =================================================================== RCS file: /cvs/dash/src/eval.h,v retrieving revision 1.1 diff -u -r1.1 eval.h --- src/eval.h 3 Jul 2004 12:52:54 -0000 1.1 +++ src/eval.h 28 Feb 2005 15:34:09 -0000 @@ -66,3 +66,4 @@ #define SKIPCONT 2 #define SKIPFUNC 3 #define SKIPFILE 4 +#define SKIPEVAL 5