* bug with "r" command
@ 1996-08-31 0:30 J.D. Laub
0 siblings, 0 replies; only message in thread
From: J.D. Laub @ 1996-08-31 0:30 UTC (permalink / raw)
To: zsh-workers
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@clinicom.com Boulder,CO |very, very, very, very, ..." - Flying Lizards
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1996-08-31 5:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-08-31 0:30 bug with "r" command J.D. Laub
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).