]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sh: Fix some bugs with exit status from case containing ;&.
authorjilles <jilles@FreeBSD.org>
Sun, 15 Jan 2012 21:39:38 +0000 (21:39 +0000)
committerjilles <jilles@FreeBSD.org>
Sun, 15 Jan 2012 21:39:38 +0000 (21:39 +0000)
commit0ae130814a5b5ff84bc63b403e50eab143d5eddc
tree1b3dae3bc843b68f70d43cdc73e4cb560bc9baeb
parent286401123342863782d27c80567e650d22f2ac91
sh: Fix some bugs with exit status from case containing ;&.

Also, rework evalcase() to not evaluate any tree. Instead, return the
NCLISTFALLTHRU node and handle it in evaltree().

Fixed bugs:

* If a ;& list with non-zero exit status is followed by an empty ;; or final
  list, the exit status of the case command should be equal to the exit
  status of the ;& list, not 0.

* An empty ;& case should not reset $?.
bin/sh/eval.c
tools/regression/bin/sh/builtins/case17.0 [new file with mode: 0644]
tools/regression/bin/sh/builtins/case18.0 [new file with mode: 0644]
tools/regression/bin/sh/builtins/case19.0 [new file with mode: 0644]