mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-02-25 00:01:30 +01:00
slightly improved (z) flag for parsing conditions; recognising glob flags in conditions still doesn't work (12237)
This commit is contained in:
parent
6ef0d9767f
commit
c3082d546e
3 changed files with 22 additions and 8 deletions
|
@ -1,3 +1,9 @@
|
|||
2000-07-13 Sven Wischnowsky <wischnow@zsh.org>
|
||||
|
||||
* 12237: Src/hist.c, Src/lex.c: slightly improved (z) flag for
|
||||
parsing conditions; recognising glob flags in conditions still
|
||||
doesn't work
|
||||
|
||||
2000-07-12 Peter Stephenson <pws@cambridgesiliconradio.com>
|
||||
|
||||
* 12231: Completion/Core/compinstall: fix setting of list-prompt.
|
||||
|
|
15
Src/hist.c
15
Src/hist.c
|
@ -2057,16 +2057,16 @@ unlockhistfile(char *fn)
|
|||
mod_export LinkList
|
||||
bufferwords(LinkList list, char *buf, int *index)
|
||||
{
|
||||
int num = 0, cur = -1, got = 0, ne = noerrs, ocs = cs;
|
||||
int owb = wb, owe = we, oadx = addedx, ozp = zleparse, oexp = expanding;
|
||||
int num = 0, cur = -1, got = 0, ne = noerrs, ocs = cs, oll = ll;
|
||||
int owb = wb, owe = we, oadx = addedx, ozp = zleparse, onc = nocomments;
|
||||
char *p;
|
||||
|
||||
if (!list)
|
||||
list = newlinklist();
|
||||
|
||||
zleparse = 3;
|
||||
zleparse = 1;
|
||||
addedx = 0;
|
||||
noerrs = expanding = 1;
|
||||
noerrs = 1;
|
||||
lexsave();
|
||||
if (buf) {
|
||||
int l = strlen(buf);
|
||||
|
@ -2076,7 +2076,8 @@ bufferwords(LinkList list, char *buf, int *index)
|
|||
p[l] = ' ';
|
||||
p[l + 1] = '\0';
|
||||
inpush(p, 0, NULL);
|
||||
cs = 0;
|
||||
cs = strlen(p) + 1;
|
||||
nocomments = 1;
|
||||
} else if (!isfirstln && chline) {
|
||||
p = (char *) zhalloc(hptr - chline + ll + 2);
|
||||
memcpy(p, chline, hptr - chline);
|
||||
|
@ -2092,6 +2093,7 @@ bufferwords(LinkList list, char *buf, int *index)
|
|||
p[ll + 1] = '\0';
|
||||
inpush(p, 0, NULL);
|
||||
}
|
||||
ll = strlen(p);
|
||||
if (cs)
|
||||
cs--;
|
||||
strinbeg(0);
|
||||
|
@ -2133,10 +2135,11 @@ bufferwords(LinkList list, char *buf, int *index)
|
|||
inpop();
|
||||
errflag = 0;
|
||||
zleparse = ozp;
|
||||
expanding = oexp;
|
||||
nocomments = onc;
|
||||
noerrs = ne;
|
||||
lexrestore();
|
||||
cs = ocs;
|
||||
ll = oll;
|
||||
wb = owb;
|
||||
we = owe;
|
||||
addedx = oadx;
|
||||
|
|
|
@ -116,7 +116,12 @@ mod_export int parbegin;
|
|||
|
||||
/**/
|
||||
mod_export int parend;
|
||||
|
||||
/* don't recognize comments */
|
||||
|
||||
/**/
|
||||
mod_export int nocomments;
|
||||
|
||||
/* text of puctuation tokens */
|
||||
|
||||
/**/
|
||||
|
@ -672,8 +677,8 @@ gettok(void)
|
|||
|
||||
/* chars in initial position in word */
|
||||
|
||||
if (c == hashchar &&
|
||||
((zleparse != 3 && isset(INTERACTIVECOMMENTS)) ||
|
||||
if (c == hashchar && !nocomments &&
|
||||
(isset(INTERACTIVECOMMENTS) ||
|
||||
(!zleparse && !expanding &&
|
||||
(!interact || unset(SHINSTDIN) || strin)))) {
|
||||
/* History is handled here to prevent extra *
|
||||
|
|
Loading…
Reference in a new issue