diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-14 16:51:58 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-14 16:51:58 +0000 |
commit | 94e87bc83d81e1226224e39c50b4eea8384bbdcf (patch) | |
tree | 7c26420347760134bc148ef14d68ace3bcdd0bcb /shell/ash.c | |
parent | 28bf671d6d92d0c2842bd5f4555f5af937a0a6db (diff) | |
download | busybox-w32-94e87bc83d81e1226224e39c50b4eea8384bbdcf.tar.gz busybox-w32-94e87bc83d81e1226224e39c50b4eea8384bbdcf.tar.bz2 busybox-w32-94e87bc83d81e1226224e39c50b4eea8384bbdcf.zip |
ash: explain why "set -o BOGUS" doesn't abort
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c index 612172043..10eb90d30 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -9075,6 +9075,23 @@ setparam(char **argv) | |||
9075 | /* | 9075 | /* |
9076 | * Process shell options. The global variable argptr contains a pointer | 9076 | * Process shell options. The global variable argptr contains a pointer |
9077 | * to the argument list; we advance it past the options. | 9077 | * to the argument list; we advance it past the options. |
9078 | * | ||
9079 | * SUSv3 section 2.8.1 "Consequences of Shell Errors" says: | ||
9080 | * For a non-interactive shell, an error condition encountered | ||
9081 | * by a special built-in ... shall cause the shell to write a diagnostic message | ||
9082 | * to standard error and exit as shown in the following table: | ||
9083 | * Error Special Built-In | ||
9084 | * ... | ||
9085 | * Utility syntax error (option or operand error) Shall exit | ||
9086 | * ... | ||
9087 | * However, in bug 1142 (http://busybox.net/bugs/view.php?id=1142) | ||
9088 | * we see that bash does not do that (set "finishes" with error code 1 instead, | ||
9089 | * and shell continues), and people rely on this behavior! | ||
9090 | * Testcase: | ||
9091 | * set -o barfoo 2>/dev/null | ||
9092 | * echo $? | ||
9093 | * | ||
9094 | * Oh well. Let's mimic that. | ||
9078 | */ | 9095 | */ |
9079 | static int | 9096 | static int |
9080 | minus_o(char *name, int val) | 9097 | minus_o(char *name, int val) |