prevent multiple occurrences of TOKSEP in replace.c
This commit is contained in:
parent
59fe948f83
commit
797441009d
2 changed files with 7 additions and 3 deletions
|
@ -26,7 +26,7 @@ TABGEN = $(EMHOME)/bin/tabgen
|
||||||
# What C compiler to use and how
|
# What C compiler to use and how
|
||||||
CC = cc
|
CC = cc
|
||||||
COPTIONS = -O
|
COPTIONS = -O
|
||||||
LDFLAGS = -i
|
LDFLAGS =
|
||||||
|
|
||||||
# What parser generator to use and how
|
# What parser generator to use and how
|
||||||
GEN = $(EMHOME)/bin/LLgen
|
GEN = $(EMHOME)/bin/LLgen
|
||||||
|
|
|
@ -297,10 +297,12 @@ actual(repl)
|
||||||
It keeps in account the opening and closing brackets,
|
It keeps in account the opening and closing brackets,
|
||||||
preprocessor numbers, strings and character constants.
|
preprocessor numbers, strings and character constants.
|
||||||
*/
|
*/
|
||||||
register int ch;
|
register int ch = 0;
|
||||||
register int level = 0, nostashraw = 0;
|
register int level = 0, nostashraw = 0;
|
||||||
|
int lastch;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
lastch = ch;
|
||||||
ch = GetChar();
|
ch = GetChar();
|
||||||
|
|
||||||
if (Unstacked) {
|
if (Unstacked) {
|
||||||
|
@ -469,8 +471,10 @@ a_new_line: ch = GetChar();
|
||||||
return ')';
|
return ')';
|
||||||
}
|
}
|
||||||
stash(repl, ch, !nostashraw);
|
stash(repl, ch, !nostashraw);
|
||||||
} else
|
} else {
|
||||||
|
if (lastch == TOKSEP && ch == TOKSEP) continue;
|
||||||
stash(repl, ch, !nostashraw);
|
stash(repl, ch, !nostashraw);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue