mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-26 05:51:08 +02:00
34590: queue_signals() around more scopes that manipulate global state
This commit is contained in:
parent
b237ba0a8e
commit
a4ff8e6957
3 changed files with 23 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2015-02-20 Barton E. Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
|
* 34590: Src/exec.c, Src/text.c: queue_signals() around more
|
||||||
|
scopes that manipulate global state
|
||||||
|
|
||||||
2015-02-20 Peter Stephenson <p.stephenson@samsung.com>
|
2015-02-20 Peter Stephenson <p.stephenson@samsung.com>
|
||||||
|
|
||||||
* 34587: Src/utils.c, Test/D07multibyte.ztst: ensure multibyte
|
* 34587: Src/utils.c, Test/D07multibyte.ztst: ensure multibyte
|
||||||
|
|
|
@ -2337,6 +2337,7 @@ addvars(Estate state, Wordcode pc, int addflags)
|
||||||
void
|
void
|
||||||
setunderscore(char *str)
|
setunderscore(char *str)
|
||||||
{
|
{
|
||||||
|
queue_signals();
|
||||||
if (str && *str) {
|
if (str && *str) {
|
||||||
int l = strlen(str) + 1, nl = (l + 31) & ~31;
|
int l = strlen(str) + 1, nl = (l + 31) & ~31;
|
||||||
|
|
||||||
|
@ -2354,6 +2355,7 @@ setunderscore(char *str)
|
||||||
*zunderscore = '\0';
|
*zunderscore = '\0';
|
||||||
underscoreused = 1;
|
underscoreused = 1;
|
||||||
}
|
}
|
||||||
|
unqueue_signals();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* These describe the type of expansions that need to be done on the words
|
/* These describe the type of expansions that need to be done on the words
|
||||||
|
@ -5319,7 +5321,7 @@ execsave(void)
|
||||||
{
|
{
|
||||||
struct execstack *es;
|
struct execstack *es;
|
||||||
|
|
||||||
es = (struct execstack *) malloc(sizeof(struct execstack));
|
es = (struct execstack *) zalloc(sizeof(struct execstack));
|
||||||
es->list_pipe_pid = list_pipe_pid;
|
es->list_pipe_pid = list_pipe_pid;
|
||||||
es->nowait = nowait;
|
es->nowait = nowait;
|
||||||
es->pline_level = pline_level;
|
es->pline_level = pline_level;
|
||||||
|
|
15
Src/text.c
15
Src/text.c
|
@ -173,6 +173,8 @@ getpermtext(Eprog prog, Wordcode c, int start_indent)
|
||||||
{
|
{
|
||||||
struct estate s;
|
struct estate s;
|
||||||
|
|
||||||
|
queue_signals();
|
||||||
|
|
||||||
if (!c)
|
if (!c)
|
||||||
c = prog->prog;
|
c = prog->prog;
|
||||||
|
|
||||||
|
@ -193,6 +195,9 @@ getpermtext(Eprog prog, Wordcode c, int start_indent)
|
||||||
*tptr = '\0';
|
*tptr = '\0';
|
||||||
freeeprog(prog); /* mark as unused */
|
freeeprog(prog); /* mark as unused */
|
||||||
untokenize(tbuf);
|
untokenize(tbuf);
|
||||||
|
|
||||||
|
unqueue_signals();
|
||||||
|
|
||||||
return tbuf;
|
return tbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,6 +211,8 @@ getjobtext(Eprog prog, Wordcode c)
|
||||||
|
|
||||||
struct estate s;
|
struct estate s;
|
||||||
|
|
||||||
|
queue_signals();
|
||||||
|
|
||||||
if (!c)
|
if (!c)
|
||||||
c = prog->prog;
|
c = prog->prog;
|
||||||
|
|
||||||
|
@ -224,6 +231,9 @@ getjobtext(Eprog prog, Wordcode c)
|
||||||
*tptr = '\0';
|
*tptr = '\0';
|
||||||
freeeprog(prog); /* mark as unused */
|
freeeprog(prog); /* mark as unused */
|
||||||
untokenize(jbuf);
|
untokenize(jbuf);
|
||||||
|
|
||||||
|
unqueue_signals();
|
||||||
|
|
||||||
return jbuf;
|
return jbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -883,6 +893,9 @@ getredirs(LinkList redirs)
|
||||||
">", ">|", ">>", ">>|", "&>", "&>|", "&>>", "&>>|", "<>", "<",
|
">", ">|", ">>", ">>|", "&>", "&>|", "&>>", "&>>|", "<>", "<",
|
||||||
"<<", "<<-", "<<<", "<&", ">&", NULL /* >&- */, "<", ">"
|
"<<", "<<-", "<<<", "<&", ">&", NULL /* >&- */, "<", ">"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
queue_signals();
|
||||||
|
|
||||||
taddchr(' ');
|
taddchr(' ');
|
||||||
for (n = firstnode(redirs); n; incnode(n)) {
|
for (n = firstnode(redirs); n; incnode(n)) {
|
||||||
Redir f = (Redir) getdata(n);
|
Redir f = (Redir) getdata(n);
|
||||||
|
@ -970,4 +983,6 @@ getredirs(LinkList redirs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tptr--;
|
tptr--;
|
||||||
|
|
||||||
|
unqueue_signals();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue