[BusyBox] Re: ash bug

Jean Wolter jean.wolter at inf.tu-dresden.de
Wed Jul 30 19:41:08 UTC 2003


Jean Wolter <jean.wolter at inf.tu-dresden.de> writes:

>     - ash doesn't ignore the sequence, it simply implements it
>       wrong. It does the redirection before printing the debug output
>       in evalcommand().

I don't know whether this has any other side effects, but if I simply
move the redirection behind the debug output the small script works as
expected.

--- ash.c       Tue Jul 29 09:15:17 2003
+++ ash.c.new   Wed Jul 30 21:32:42 2003
@@ -3248,9 +3248,6 @@
        if (iflag && funcnest == 0 && argc > 0)
                lastarg = nargv[-1];
 
-       expredir(cmd->ncmd.redirect);
-       status = redirectsafe(cmd->ncmd.redirect, REDIR_PUSH);
-
        path = vpath.text;
        for (argp = cmd->ncmd.assign; argp; argp = argp->narg.next) {
                struct strlist **spp;
@@ -3279,6 +3276,9 @@
                out2c('\n');
                flushall();
        }
+
+       expredir(cmd->ncmd.redirect);
+       status = redirectsafe(cmd->ncmd.redirect, REDIR_PUSH);
 
        cmd_is_exec = 0;
        spclbltin = -1;

regards,
Jean



More information about the busybox mailing list