mirror of git://git.code.sf.net/p/zsh/code
Fix "vared -h" in shell scripts.
This commit is contained in:
parent
e14a02f440
commit
9bf7fb75c5
|
@ -1,3 +1,8 @@
|
|||
2000-10-20 Bart Schaefer <schaefer@zsh.org>
|
||||
|
||||
* 13055: Src/hist.c, Src/Zle/zle_main.c: Fix `vared -h' for non-
|
||||
interactive shells (scripts).
|
||||
|
||||
2000-10-19 Sven Wischnowsky <wischnow@zsh.org>
|
||||
|
||||
* 13036: Completion/Commands/_bash_completions,
|
||||
|
|
|
@ -903,7 +903,7 @@ bin_vared(char *name, char **args, char *ops, int func)
|
|||
if (ops['e'])
|
||||
isfirstln = 1;
|
||||
if (ops['h'])
|
||||
hbegin(1);
|
||||
hbegin(2);
|
||||
t = (char *) zleread(p1, p2, ops['h'] ? ZLRF_HISTORY : 0);
|
||||
if (ops['h'])
|
||||
hend(NULL);
|
||||
|
|
|
@ -736,7 +736,12 @@ hbegin(int dohist)
|
|||
{
|
||||
isfirstln = isfirstch = 1;
|
||||
errflag = histdone = 0;
|
||||
stophist = (!dohist || !interact || unset(SHINSTDIN)) ? 2 : 0;
|
||||
if (!dohist)
|
||||
stophist = 2;
|
||||
else if (dohist != 2)
|
||||
stophist = (!interact || unset(SHINSTDIN)) ? 2 : 0;
|
||||
else
|
||||
stophist = 0;
|
||||
if (stophist == 2 || (inbufflags & INP_ALIAS)) {
|
||||
chline = hptr = NULL;
|
||||
hlinesz = 0;
|
||||
|
@ -764,7 +769,7 @@ hbegin(int dohist)
|
|||
|
||||
if (hist_ring && !hist_ring->ftim)
|
||||
hist_ring->ftim = time(NULL);
|
||||
if (interact && isset(SHINSTDIN) && !strin) {
|
||||
if ((dohist == 2 || (interact && isset(SHINSTDIN))) && !strin) {
|
||||
histactive = HA_ACTIVE;
|
||||
attachtty(mypgrp);
|
||||
linkcurline();
|
||||
|
|
Loading…
Reference in New Issue