yyrecursive needs its own and empty heres[]
fixes http://thread.gmane.org/gmane.comp.shells.dash/1241/focus=1245
This commit is contained in:
parent
3b5f9c744c
commit
4a21365067
6
syn.c
6
syn.c
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.110 2016/01/21 18:24:44 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.111 2016/02/26 21:24:58 tg Exp $");
|
||||||
|
|
||||||
struct nesting_state {
|
struct nesting_state {
|
||||||
int start_token; /* token than began nesting (eg, FOR) */
|
int start_token; /* token than began nesting (eg, FOR) */
|
||||||
@ -31,6 +31,7 @@ struct nesting_state {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct yyrecursive_state {
|
struct yyrecursive_state {
|
||||||
|
struct ioword *old_heres[HERES];
|
||||||
struct yyrecursive_state *next;
|
struct yyrecursive_state *next;
|
||||||
struct ioword **old_herep;
|
struct ioword **old_herep;
|
||||||
int old_symbol;
|
int old_symbol;
|
||||||
@ -1175,7 +1176,9 @@ yyrecursive(int subtype MKSH_A_UNUSED)
|
|||||||
ys->old_reject = reject;
|
ys->old_reject = reject;
|
||||||
ys->old_symbol = symbol;
|
ys->old_symbol = symbol;
|
||||||
ACCEPT;
|
ACCEPT;
|
||||||
|
memcpy(ys->old_heres, heres, sizeof(heres));
|
||||||
ys->old_herep = herep;
|
ys->old_herep = herep;
|
||||||
|
herep = heres;
|
||||||
ys->old_salias = sALIAS;
|
ys->old_salias = sALIAS;
|
||||||
sALIAS = 0;
|
sALIAS = 0;
|
||||||
ys->next = e->yyrecursive_statep;
|
ys->next = e->yyrecursive_statep;
|
||||||
@ -1202,6 +1205,7 @@ yyrecursive_pop(bool popall)
|
|||||||
e->yyrecursive_statep = ys->next;
|
e->yyrecursive_statep = ys->next;
|
||||||
|
|
||||||
sALIAS = ys->old_salias;
|
sALIAS = ys->old_salias;
|
||||||
|
memcpy(heres, ys->old_heres, sizeof(heres));
|
||||||
herep = ys->old_herep;
|
herep = ys->old_herep;
|
||||||
reject = ys->old_reject;
|
reject = ys->old_reject;
|
||||||
symbol = ys->old_symbol;
|
symbol = ys->old_symbol;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user