summary refs log tree commit diff
path: root/Src/builtin.c
diff options
context:
space:
mode:
authorPeter Stephenson <p.stephenson@samsung.com>2018-06-20 12:09:43 +0100
committerPeter Stephenson <p.stephenson@samsung.com>2018-06-20 12:09:43 +0100
commiteada7e1138a3fca90f085dd764ad86098e58c9ac (patch)
treeec7df71375da7ac82ea9c67f2fa6685b92a42239 /Src/builtin.c
parent7caec474de577e59a6cf45952e5b87712967aa45 (diff)
downloadzsh-eada7e1138a3fca90f085dd764ad86098e58c9ac.tar.gz
zsh-eada7e1138a3fca90f085dd764ad86098e58c9ac.tar.xz
zsh-eada7e1138a3fca90f085dd764ad86098e58c9ac.zip
43077: Fix shift builtin status.
If the math evaulation to get the shift count failed the status
wasn't passed back from the builtin.
Diffstat (limited to 'Src/builtin.c')
-rw-r--r--Src/builtin.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index 1cba97dec..93fa9112c 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -5318,8 +5318,13 @@ bin_shift(char *name, char **argv, Options ops, UNUSED(int func))
 
     /* optional argument can be either numeric or an array */
     queue_signals();
-    if (*argv && !getaparam(*argv))
+    if (*argv && !getaparam(*argv)) {
         num = mathevali(*argv++);
+	if (errflag) {
+	    unqueue_signals();
+	    return 1;
+	}
+    }
 
     if (num < 0) {
 	unqueue_signals();