about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/builtin.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index ee44b3776..654665bfc 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -4443,6 +4443,11 @@ bin_break(char *name, char **argv, UNUSED(Options ops), int func)
 	nump = 1;
     }
 
+    if (nump > 0 && (func == BIN_CONTINUE || func == BIN_BREAK) && num <= 0) {
+	zerrnam(name, "argument is not positive: %d", num);
+	return 1;
+    }
+
     switch (func) {
     case BIN_CONTINUE:
 	if (!loops) {   /* continue is only permitted in loops */