1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-06-13 04:56:30 +02:00

15327: always use local LINENOs in parse_string().

This commit is contained in:
Peter Stephenson 2001-07-09 16:05:13 +00:00
parent 18496bfebc
commit 003ec8c7e8
8 changed files with 22 additions and 14 deletions

View File

@ -1,3 +1,11 @@
2001-07-09 Peter Stephenson <pws@csr.com>
* 15327: Src/builtin.c, Src/exec.c, Src/glob.c, Src/parse.c,
Src/Modules/parameter.c, Src/Modules/zpty.c, Src/Modules/zutil.c:
Always use local LINENOs in parse_string(). Currently we only
do this sometimes in order for existing $LINENO to show through.
This seems to cause more problems than it solves.
2001-07-07 Bart Schaefer <schaefer@zsh.org>
* 15308: Src/builtin.c: Fix infinite loop on `r OLD=NEW' when OLD

View File

@ -342,7 +342,7 @@ setfunction(char *name, char *val, int dis)
val = metafy(val, strlen(val), META_REALLOC);
prog = parse_string(val, 1);
prog = parse_string(val);
if (!prog || prog == &dummy_eprog) {
zwarn("invalid function definition", value, 0);

View File

@ -276,7 +276,7 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock)
int master, slave, pid;
Eprog prog;
prog = parse_string(zjoin(args, ' ', 1), 0);
prog = parse_string(zjoin(args, ' ', 1));
if (!prog) {
errflag = 0;
return 1;

View File

@ -115,7 +115,7 @@ setstypat(Style s, char *pat, Patprog prog, char **vals, int eval)
if (eval) {
int ef = errflag;
eprog = parse_string(zjoin(vals, ' ', 1), 0);
eprog = parse_string(zjoin(vals, ' ', 1));
errflag = ef;
if (!eprog)

View File

@ -3421,7 +3421,7 @@ bin_eval(char *nam, char **argv, char *ops, int func)
{
Eprog prog;
prog = parse_string(zjoin(argv, ' ', 1), 0);
prog = parse_string(zjoin(argv, ' ', 1));
if (!prog) {
errflag = 0;
return 1;
@ -4027,7 +4027,7 @@ bin_trap(char *name, char **argv, char *ops, int func)
arg = *argv++;
if (!*arg)
prog = &dummy_eprog;
else if (!(prog = parse_string(arg, 0))) {
else if (!(prog = parse_string(arg))) {
zwarnnam(name, "couldn't parse trap command", NULL, 0);
return 1;
}

View File

@ -147,15 +147,15 @@ static int (*execfuncs[]) _((Estate, int)) = {
/**/
mod_export Eprog
parse_string(char *s, int ln)
parse_string(char *s)
{
Eprog p;
int oldlineno = lineno;
lexsave();
inpush(s, (ln ? INP_LINENO : 0), NULL);
inpush(s, INP_LINENO, NULL);
strinbeg(0);
lineno = ln ? 1 : -1;
lineno = 1;
p = parse_list();
lineno = oldlineno;
strinend();
@ -711,7 +711,7 @@ execstring(char *s, int dont_change_job, int exiting)
Eprog prog;
pushheap();
if ((prog = parse_string(s, 0)))
if ((prog = parse_string(s)))
execode(prog, dont_change_job, exiting);
popheap();
}
@ -2669,7 +2669,7 @@ getoutput(char *cmd, int qt)
pid_t pid;
Wordcode pc;
if (!(prog = parse_string(cmd, 0)))
if (!(prog = parse_string(cmd)))
return NULL;
pc = prog->prog;
@ -2800,7 +2800,7 @@ parsecmd(char *cmd)
return NULL;
}
*str = '\0';
if (str[1] || !(prog = parse_string(cmd + 2, 0))) {
if (str[1] || !(prog = parse_string(cmd + 2))) {
zerr("parse error in process substitution", NULL, 0);
return NULL;
}
@ -3496,7 +3496,7 @@ getfpfunc(char *s, int *ksh)
d = metafy(d, len, META_REALLOC);
scriptname = dupstring(s);
r = parse_string(d, 1);
r = parse_string(d);
scriptname = oldscriptname;
zfree(d, len + 1);

View File

@ -2632,7 +2632,7 @@ qualsheval(char *name, struct stat *buf, off_t days, char *str)
{
Eprog prog;
if ((prog = parse_string(str, 0))) {
if ((prog = parse_string(str))) {
int ef = errflag, lv = lastval, ret;
unsetparam("reply");

View File

@ -2602,7 +2602,7 @@ build_dump(char *nam, char *dump, char **files, int ali, int map, int flags)
close(fd);
file = metafy(file, flen, META_REALLOC);
if (!(prog = parse_string(file, 1)) || errflag) {
if (!(prog = parse_string(file)) || errflag) {
errflag = 0;
close(dfd);
zfree(file, flen);