/* read the replacement text if there is any */
ch = skipspaces(ch,0); /* find first character of the text */
ASSERT(ch != EOI);
- UnGetChar();
+ /* UngetChar() is not right when replacement starts with a '/' */
+ ChPushBack(ch);
repl_text = get_text((nformals > 0) ? formals : 0, &length);
macro_def(id, repl_text, nformals, length, NOFLAG);
LineNumber++;
c = GetChar();
if (c == '*') {
skipcomment();
- if(blank++) add2repl(repl, ' ');
+ if (!blank++) add2repl(repl, ' ');
c = GetChar();
continue;
- }
- else add2repl(repl, '/');
+ } else add2repl(repl, '/');
} else if (formals
&& (class(c) == STIDF || class(c) == STELL)) {
char id_buf[IDFSIZE + 1];
/* read the replacement text if there is any */
ch = skipspaces(ch,0); /* find first character of the text */
assert(ch != EOI);
- UnGetChar();
+ /* UngetChar() is not right when replacement starts with a '/' */
+ ChPushBack(ch);
repl_text = get_text((nformals > 0) ? formals : 0, &length);
macro_def(str2idf(str, 0), repl_text, nformals, length, NOFLAG);
LineNumber++;