summary refs log tree commit diff
path: root/Src/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/input.c')
-rw-r--r--Src/input.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Src/input.c b/Src/input.c
index 92abaec92..9787dedf6 100644
--- a/Src/input.c
+++ b/Src/input.c
@@ -144,9 +144,10 @@ shingetline(void)
     int q = queue_signal_level();
 
     p = buf;
+    winch_unblock();
+    dont_queue_signals();
     for (;;) {
-	winch_unblock();
-	dont_queue_signals();
+	/* Can't fgets() here because we need to accept '\0' bytes */
 	do {
 	    errno = 0;
 	    c = fgetc(bshin);
@@ -176,7 +177,8 @@ shingetline(void)
 	    ll += p - buf;
 	    line[ll] = '\0';
 	    p = buf;
-	    unqueue_signals();
+	    winch_unblock();
+	    dont_queue_signals();
 	}
     }
 }