From b8907b986b739e3c6b07e5df3f4cf4794dc2bc64 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Fri, 21 Jan 2000 10:10:08 +0000 Subject: zsh-workers/9396 --- Src/Zle/zle_main.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Src/Zle/zle_main.c') diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index abf870655..e82c361d3 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -734,7 +734,7 @@ bin_vared(char *name, char **args, char *ops, int func) char *s, *t, *ova = varedarg; Value v; Param pm = 0; - int create = 0; + int create = 0, ifl; int type = PM_SCALAR, obreaks = breaks, haso = 0; char *p1 = NULL, *p2 = NULL; FILE *oshout = NULL; @@ -787,6 +787,10 @@ bin_vared(char *name, char **args, char *ops, int func) /* -h option -- enable history */ ops['h'] = 1; break; + case 'e': + /* -e option -- enable EOF */ + ops['e'] = 1; + break; default: /* unrecognised option character */ zwarnnam(name, "unknown option: %s", *args, 0); @@ -834,7 +838,15 @@ bin_vared(char *name, char **args, char *ops, int func) pushnode(bufstack, ztrdup(s)); } LASTALLOC; varedarg = *args; + ifl = isfirstln; + if (ops['e']) + isfirstln = 1; + if (ops['h']) + hbegin(1); t = (char *) zleread(p1, p2, ops['h'] ? ZLRF_HISTORY : 0); + if (ops['h']) + hend(); + isfirstln = ifl; varedarg = ova; if (haso) { close(SHTTY); -- cgit 1.4.1