diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2007-12-11 14:05:52 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2007-12-11 14:05:52 +0000 |
commit | 04f42fdbdf14924e2e2b8bce4c1d1b4537747676 (patch) | |
tree | e4527a76d216f2edc3bbb56e2d3aa14aa3b253d8 /Src | |
parent | 8718b9bf0973d21b8e33d67b28a67ab0e0153991 (diff) | |
download | zsh-04f42fdbdf14924e2e2b8bce4c1d1b4537747676.tar.gz zsh-04f42fdbdf14924e2e2b8bce4c1d1b4537747676.tar.xz zsh-04f42fdbdf14924e2e2b8bce4c1d1b4537747676.zip |
24210: set -o should abort on failure
Diffstat (limited to 'Src')
-rw-r--r-- | Src/builtin.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Src/builtin.c b/Src/builtin.c index d69ab5591..2e0d249f3 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -567,9 +567,9 @@ bin_set(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) return 0; } if(!(optno = optlookup(*args))) - zwarnnam(nam, "no such option: %s", *args); + zerrnam(nam, "no such option: %s", *args); else if(dosetopt(optno, action, 0)) - zwarnnam(nam, "can't change option: %s", *args); + zerrnam(nam, "can't change option: %s", *args); break; } else if(**args == 'A') { if(!*++*args) @@ -588,13 +588,15 @@ bin_set(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) sort = action ? 1 : -1; else { if (!(optno = optlookupc(**args))) - zwarnnam(nam, "bad option: -%c", **args); + zerrnam(nam, "bad option: -%c", **args); else if(dosetopt(optno, action, 0)) - zwarnnam(nam, "can't change option: -%c", **args); + zerrnam(nam, "can't change option: -%c", **args); } } args++; } + if (errflag) + return 1; doneoptions: inittyptab(); |