we need not only store into the retrace buffers recursively but also ungetsc

This commit is contained in:
tg
2011-03-13 16:20:45 +00:00
parent 91ec264cb8
commit 4e7d9bdb33
2 changed files with 13 additions and 4 deletions

11
lex.c
View File

@@ -22,7 +22,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.140 2011/03/13 16:07:36 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.141 2011/03/13 16:20:45 tg Exp $");
/*
* states while lexing word
@@ -1729,13 +1729,18 @@ arraysub(char **strp)
static void
ungetsc(int c)
{
struct sretrace_info *rp = retrace_info;
if (backslash_skip)
backslash_skip--;
/* Don't unget EOF... */
if (source->str == null && c == '\0')
return;
if (retrace_info && Xlength(retrace_info->xs, retrace_info->xp))
retrace_info->xp--;
while (rp) {
if (Xlength(rp->xs, rp->xp))
rp->xp--;
rp = rp->next;
}
ungetsc_(c);
}
static void