do_error()
{
- static char errbuf[512];
- register char *bp = errbuf;
- register int ch;
+ int len;
+ char *get_text();
+ char *bp = get_text((char **) 0, &len);
- while ((ch = GetChar()) != '\n')
- *bp++ = ch;
- *bp = '\0';
- UnGetChar();
- lexerror("user error: %s", errbuf);
+ lexerror("user error: %s", bp);
+ free(bp);
+ LineNumber++;
}
int
if (c == '\\') add2repl(repl, GetChar());
c = GetChar();
} while (c != delim && c != EOI && class(c) != STNL);
+ if (c == EOI || class(c) == STNL) {
+ lexstrict("unclosed opening %c", delim);
+ break;
+ }
add2repl(repl, c);
c = GetChar();
} else if (c == '/') {
do_error()
{
- static char errbuf[512];
- register char *bp = errbuf;
- register int ch;
+ int len;
+ char *get_text();
+ char *bp = get_text((char **) 0, &len);
- while ((ch = GetChar()) != '\n')
- *bp++ = ch;
- *bp = '\0';
- UnGetChar();
- error("user error: %s", errbuf);
+ error("user error: %s", bp);
+ free(bp);
+ LineNumber++;
}
int
if (c == '\\') add2repl(repl, GetChar());
c = GetChar();
} while (c != delim && c != EOI && class(c) != STNL);
+ if (c != delim) {
+ strict("unclosed opening %c", delim);
+ break;
+ }
add2repl(repl, c);
c = GetChar();
} else if (c == '/') {