Fix bug handling 0xff after #

We were treating byte 0xff as EOF after a `#` which wasn't handled by
the preprocessor on platforms with signed char, while EOF was treated as
byte 0xff on platforms with unsigned char.
This commit is contained in:
Olly Betts 2024-10-09 08:21:57 +13:00
parent ea8aa84b28
commit 4be9274c82
1 changed files with 3 additions and 5 deletions

View File

@ -1554,21 +1554,19 @@ String *Scanner_text(Scanner *s) {
* ----------------------------------------------------------------------------- */
void Scanner_skip_line(Scanner *s) {
char c;
int done = 0;
Clear(s->text);
Setfile(s->text, Getfile(s->str));
Setline(s->text, s->line);
while (!done) {
while (1) {
int c;
if ((c = nextchar(s)) == EOF)
return;
if (c == '\\') {
nextchar(s);
} else if (c == '\n') {
done = 1;
return;
}
}
return;
}
/* -----------------------------------------------------------------------------