sh: Fix $? in the first command of a 'for'.
authorPeter Avalos <pavalos@dragonflybsd.org>
Sun, 5 Feb 2012 20:12:44 +0000 (12:12 -0800)
committerPeter Avalos <pavalos@dragonflybsd.org>
Sun, 5 Feb 2012 20:48:25 +0000 (12:48 -0800)
commit723ecb596978d3ed4d37a449ce636a35c743ec80
tree21d39ac99cf333959675d5dead1df04378592a5b
parent123973d7ccb9bf681d124de73d64c3d7eb73e7fa
sh: Fix $? in the first command of a 'for'.

In the first command of a 'for', $? should be the exit status of the last
pipeline (command substitution in the word list or command before 'for'),
not always 0.

Obtained-from:  FreeBSD 230463
bin/sh/eval.c
tools/regression/bin/sh/builtins/for2.0 [new file with mode: 0644]
tools/regression/bin/sh/builtins/for3.0 [new file with mode: 0644]