1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-23 13:41:12 +01:00

34322: bug with interface to parsestr() etc.

Was showing up in places like ${(e)...} where command substitution
could reallocate the token string, but actually there was never any
guarantee that the lexer wouldn't do that, so this was always
a bit iffy.
This commit is contained in:
Peter Stephenson 2015-01-18 22:38:57 +00:00
parent 6856ab39e3
commit c6c9f5daf2
11 changed files with 59 additions and 26 deletions

View file

@ -3772,19 +3772,20 @@ gethere(char **strp, int typ)
*bptr++ = '\n';
}
*t = '\0';
s = buf;
buf = dupstring(buf);
zfree(s, bsiz);
if (!qt) {
int ef = errflag;
parsestr(buf);
parsestr(&buf);
if (!errflag) {
/* Retain any user interrupt error */
errflag = ef | (errflag & ERRFLAG_INT);
}
}
s = dupstring(buf);
zfree(buf, bsiz);
return s;
return buf;
}
/* open here string fd */