Fix: prevent unintentional token pasting

This commit is contained in:
ceriel 1994-03-01 15:04:52 +00:00
parent b03e2f6a8b
commit b8b3054bba
2 changed files with 10 additions and 0 deletions

View file

@ -350,6 +350,7 @@ actual(repl)
ch = GetChar();
} while (in_idf(ch));
*p++ = '\0';
ch = '\0'; /* It could be an unstashed TOKSEP */
UnGetChar();
/* When the identifier has an associated macro
@ -376,6 +377,7 @@ actual(repl)
if (ch == '.') {
ch = GetChar();
if (class(ch) != STNUM) {
ch = '\0'; /* It could be an unstashed TOKSEP */
UnGetChar();
continue;
}
@ -393,6 +395,7 @@ actual(repl)
}
}
}
ch = '\0'; /* It could be an unstashed TOKSEP */
UnGetChar();
} else if (ch == '(') {
/* a comma may occur between parentheses */
@ -455,6 +458,7 @@ a_new_line: ch = GetChar();
}
if (ch != '/') {
UnGetChar();
ch = ' ';
stash(repl, ' ', !nostashraw);
}
} else if (ch == '/') {
@ -464,6 +468,7 @@ a_new_line: ch = GetChar();
stash(repl, ' ', !nostashraw);
} else {
UnGetChar();
ch = '/';
stash(repl, '/', !nostashraw);
}
} else if (ch == '\'' || ch == '"') {

View file

@ -344,6 +344,7 @@ actual(repl)
ch = GetChar();
} while (in_idf(ch));
*p++ = '\0';
ch = '\0'; /* Could be a non-stashed TOKSEP */
UnGetChar();
/* When the identifier has an associated macro
@ -370,6 +371,7 @@ actual(repl)
if (ch == '.') {
ch = GetChar();
if (class(ch) != STNUM) {
ch = '\0'; /* Could be a non-stashed TOKSEP */
UnGetChar();
continue;
}
@ -387,6 +389,7 @@ actual(repl)
}
}
}
ch = '\0'; /* Could be a non-stashed TOKSEP */
UnGetChar();
} else if (ch == '(') {
/* a comma may occur within parentheses */
@ -445,6 +448,7 @@ a_new_line: ch = GetChar();
}
if (ch != '/') {
UnGetChar();
ch = ' ';
stash(repl, ' ', !nostashraw);
}
} else if (ch == '/') {
@ -454,6 +458,7 @@ a_new_line: ch = GetChar();
stash(repl, ' ', !nostashraw);
} else {
UnGetChar();
ch = '/';
stash(repl, '/', !nostashraw);
}
} else if (ch == '\'' || ch == '"') {