Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: More vared repairs



The -e option, added in zsh-workers/9396 but never mentioned in ChangeLog,
didn't do the right thing in combination with -h, because the call to
hbegin() (also added in 9396) also sets `isfirstln = 1'.  In other words,
using -h always implied -e, which probably was not the desired effect.

It further doesn't seem to me that vared should ever pay attention to the
setting of IGNOREEOF.  If you don't use -e, you can't generate an EOF in
any case, and if you use -e you've asked for EOF behavior.

Index: Src/Zle/zle_main.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_main.c,v
retrieving revision 1.12
diff -u -r1.12 zle_main.c
--- Src/Zle/zle_main.c	2000/10/21 03:15:36	1.12
+++ Src/Zle/zle_main.c	2000/10/22 02:26:39
@@ -748,7 +748,7 @@
     struct value vbuf;
     Value v;
     Param pm = 0;
-    int create = 0, ifl;
+    int create = 0, ifl, ieof;
     int type = PM_SCALAR, obreaks = breaks, haso = 0;
     char *p1 = NULL, *p2 = NULL;
     FILE *oshout = NULL;
@@ -900,11 +900,13 @@
 
     varedarg = *args;
     ifl = isfirstln;
-    if (ops['e'])
-	isfirstln = 1;
     if (ops['h'])
 	hbegin(2);
+    isfirstln = ops['e'];
+    ieof = opts[IGNOREEOF];
+    opts[IGNOREEOF] = 0;
     t = (char *) zleread(p1, p2, ops['h'] ? ZLRF_HISTORY : 0);
+    opts[IGNOREEOF] = ieof;
     if (ops['h'])
 	hend(NULL);
     isfirstln = ifl;

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author