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

bug with "r" command



Using the "r" command (sometimes?) sets $? to 0 when it should not.
This wreaks havoc with scripts that
    1) test $?, and
    2) that happen to have been run with "r".
Simple example:

Script started on Fri Aug 30 17:41:16 1996

chimay% ./zsh -f
chimay% print $ZSH_VERSION
3.0.0
chimay% fg 
fg: no current job
chimay% print $?
1
chimay% fg
fg: no current job
chimay% r pri
print $?
0
chimay% exit
chimay% exit

script done on Fri Aug 30 17:42:00 1996

Probably naive observation: the culprit looks like exec.c:1663
getting executed twice: the first changes "r pri" to "print $?", and
the second actually runs the print.  The problem is that the first
execution sets lastval to 0, and it doesn't get reset back to 1 before
the second execution.
-- 
J.D. Laub (Laubster) HBOC/CliniCom|"I think you're very, very, very, very, very,
jdl@xxxxxxxxxxxx     Boulder,CO   |very, very, very, very, ..." - Flying Lizards



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