summary refs log tree commit diff
path: root/Src/loop.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/loop.c')
-rw-r--r--Src/loop.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Src/loop.c b/Src/loop.c
index fa7602e37..3b9d02144 100644
--- a/Src/loop.c
+++ b/Src/loop.c
@@ -289,6 +289,8 @@ execselect(Estate state, UNUSED(int do_exec))
 	    	}
 	    } else
 		str = (char *)getlinknode(bufstack);
+            if (!str && !errflag)
+                setsparam("REPLY", ztrdup("")); /* EOF (user pressed Ctrl+D) */
 	    if (!str || errflag) {
 		if (breaks)
 		    breaks--;