diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-07-10 10:33:10 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-07-10 10:33:27 +0200 |
| commit | b057806a6ad7618b10db062bf6c71d09f71ce421 (patch) | |
| tree | c0f9fa4df708e768d7f3f3e1337400633702510e /shell | |
| parent | 9e55a156f8a07297f620466e8173040336a7c48c (diff) | |
| download | busybox-w32-b057806a6ad7618b10db062bf6c71d09f71ce421.tar.gz busybox-w32-b057806a6ad7618b10db062bf6c71d09f71ce421.tar.bz2 busybox-w32-b057806a6ad7618b10db062bf6c71d09f71ce421.zip | |
hush: add TODO for "set -e"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
| -rw-r--r-- | shell/hush.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/shell/hush.c b/shell/hush.c index 8223cdbc5..89cd47d8f 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
| @@ -49,6 +49,7 @@ | |||
| 49 | * [un]alias, command, fc, getopts, newgrp, readonly, times | 49 | * [un]alias, command, fc, getopts, newgrp, readonly, times |
| 50 | * make complex ${var%...} constructs support optional | 50 | * make complex ${var%...} constructs support optional |
| 51 | * make here documents optional | 51 | * make here documents optional |
| 52 | * set -e (some ash testsuite entries use it, want to adopt those) | ||
| 52 | * | 53 | * |
| 53 | * Bash compat TODO: | 54 | * Bash compat TODO: |
| 54 | * redirection of stdout+stderr: &> and >& | 55 | * redirection of stdout+stderr: &> and >& |
| @@ -8421,6 +8422,22 @@ static int set_mode(int state, char mode, const char *o_opt) | |||
| 8421 | G.o_opt[idx] = state; | 8422 | G.o_opt[idx] = state; |
| 8422 | break; | 8423 | break; |
| 8423 | } | 8424 | } |
| 8425 | /* TODO: set -e | ||
| 8426 | Exit if pipe, list, or compound command exits with a non-zero status. | ||
| 8427 | Shell does not exit if failed command is part of condition in | ||
| 8428 | if/while, part of && or || list except the last command, any command | ||
| 8429 | in a pipe but the last, or if the command's return value is being | ||
| 8430 | inverted with !. If a compound command other than a subshell returns a | ||
| 8431 | non-zero status because a command failed while -e was being ignored, the | ||
| 8432 | shell does not exit. A trap on ERR, if set, is executed before the shell | ||
| 8433 | exits [ERR is a bashism]. | ||
| 8434 | |||
| 8435 | If a compound command or function executes in a context where -e is | ||
| 8436 | ignored, none of the commands executed within are affected by the -e | ||
| 8437 | setting. If a compound command or function sets -e while executing in a | ||
| 8438 | context where -e is ignored, that setting does not have any effect until | ||
| 8439 | the compound command or the command containing the function call completes. | ||
| 8440 | */ | ||
| 8424 | default: | 8441 | default: |
| 8425 | return EXIT_FAILURE; | 8442 | return EXIT_FAILURE; |
| 8426 | } | 8443 | } |
