about summary refs log tree commit diff
path: root/Src/loop.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2003-02-17 11:41:58 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2003-02-17 11:41:58 +0000
commit40c29457f285deaba4959dd23d5f2dd859ddb956 (patch)
treeeef78ccf4dd50dd9ef37a4a8764e01ebfd9733ce /Src/loop.c
parenta71bf4a283a5a9ba58ac0057b689c4cee5c9e354 (diff)
downloadzsh-40c29457f285deaba4959dd23d5f2dd859ddb956.tar.gz
zsh-40c29457f285deaba4959dd23d5f2dd859ddb956.tar.xz
zsh-40c29457f285deaba4959dd23d5f2dd859ddb956.zip
18251: Fix select and make it respect EOF
Diffstat (limited to 'Src/loop.c')
-rw-r--r--Src/loop.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Src/loop.c b/Src/loop.c
index 4da5a50f0..ebb07445b 100644
--- a/Src/loop.c
+++ b/Src/loop.c
@@ -202,7 +202,7 @@ execselect(Estate state, int do_exec)
     wordcode code = state->pc[-1];
     char *str, *s, *name;
     LinkNode n;
-    int i, usezle;
+    int i, usezle, oignoreeof = opts[IGNOREEOF];
     FILE *inp;
     size_t more;
     LinkList args;
@@ -238,6 +238,7 @@ execselect(Estate state, int do_exec)
     inp = fdopen(dup(usezle ? SHTTY : 0), "r");
     more = selectlist(args, 0);
     loop = state->pc;
+    opts[IGNOREEOF] = 0;
     for (;;) {
 	for (;;) {
 	    if (empty(bufstack)) {
@@ -301,6 +302,7 @@ execselect(Estate state, int do_exec)
     fclose(inp);
     loops--;
     state->pc = end;
+    opts[IGNOREEOF] = oignoreeof;
     return lastval;
 }