about summary refs log tree commit diff
path: root/Src/builtin.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/builtin.c')
-rw-r--r--Src/builtin.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index 88b90cfec..5d4b2be2c 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -3159,25 +3159,22 @@ checkjobs(void)
 {
     int i;
 
-    for (i = 1; i < MAXJOB; i++) {
+    for (i = 1; i < MAXJOB; i++)
 	if (i != thisjob && (jobtab[i].stat & STAT_LOCKED) &&
-	    !(jobtab[i].stat & STAT_NOPRINT)) {
-	    if (jobtab[i].stat & STAT_STOPPED) {
+	    !(jobtab[i].stat & STAT_NOPRINT))
+	    break;
+    if (i < MAXJOB) {
+	if (jobtab[i].stat & STAT_STOPPED) {
 
 #ifdef USE_SUSPENDED
-		zerr("you have suspended jobs.", NULL, 0);
+	    zerr("you have suspended jobs.", NULL, 0);
 #else
-		zerr("you have stopped jobs.", NULL, 0);
+	    zerr("you have stopped jobs.", NULL, 0);
 #endif
 
-		stopmsg = 1;
-	    } else if (isset(HUP)) {
-		zerr("you have running jobs.", NULL, 0);
-		stopmsg = 1;
-	    }
-	    if (stopmsg)
-		break;
-	}
+	} else
+	    zerr("you have running jobs.", NULL, 0);
+	stopmsg = 1;
     }
 }