Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: hzoli13 another bug ?



> Hey Zoltan:
> 
>  I have run into another problem.
> 
>   After assigning result code of execution to a variable it has wrong value:
> 
> % egrep -q $u $DbFile
> % echo $?
> 1
> % egrep -q $u $DbFile
> % rc=$?
> % echo $rc
> 0
> 
> Again this is not in the stock beta13 version.

A patch in art. 637 from Zefram broke this.  It tried to fix a bug when an
assignment like wibble=$(false) did not set $?.  Everyone who applied the
patch in art. 637 (i.e. everyone using beta13-hzoli13) should also apply
the patch below.

Bye,

Zoltan

 *** Src/exec.c	1996/03/22 21:33:31	1.15
 --- Src/exec.c	1996/03/25 12:41:37
 ***************
 *** 1174,1182 ****
   	    } else
   		addlinknode(args, dupstring(nullcmd));
   	} else {
 - 	    lastval = 0;
   	    addvars(cmd->vars, 0);
 ! 	    if(errflag) lastval = errflag;
   	    if (isset(XTRACE)) {
   		fputc('\n', stderr);
   		fflush(stderr);
 --- 1174,1184 ----
   	    } else
   		addlinknode(args, dupstring(nullcmd));
   	} else {
   	    addvars(cmd->vars, 0);
 ! 	    if(errflag)
 ! 		lastval = errflag;
 ! 	    else
 ! 		lastval = 0;
   	    if (isset(XTRACE)) {
   		fputc('\n', stderr);
   		fflush(stderr);




Messages sorted by: Reverse Date, Date, Thread, Author