From 04f42fdbdf14924e2e2b8bce4c1d1b4537747676 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 11 Dec 2007 14:05:52 +0000 Subject: 24210: set -o should abort on failure --- Src/builtin.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Src/builtin.c') 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(); -- cgit 1.4.1