Commit bc73779
nshlib/nsh_parse: Fix "e" flag not take effect
The NSH exits when a command exits with a non-zero status, even if the "e" flag is not set.
This error does not exist in NSH scripts.
Without this patch:
nsh> sh -c "set -e; mkdir /test; echo $?"
nsh: /test: mkdir failed: 17
nsh> sh -c "set +e; mkdir /test; echo $?"
nsh: /test: mkdir failed: 17
nsh> rm /test
nsh> sh -c "set +e; mkdir /test; echo $?"
0
With this patch:
nsh> sh -c "set -e; mkdir /test; echo $?"
nsh: /test: mkdir failed: 17
nsh> sh -c "set +e; mkdir /test; echo $?"
nsh: /test: mkdir failed: 17
1
nsh> rm /test
nsh> sh -c "set +e; mkdir /test; echo $?"
0
Signed-off-by: wangjianyu3 <[email protected]>1 parent 00911d4 commit bc73779
1 file changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2936 | 2936 | | |
2937 | 2937 | | |
2938 | 2938 | | |
2939 | | - | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
2940 | 2944 | | |
2941 | 2945 | | |
2942 | 2946 | | |
| |||
0 commit comments