mirror of https://github.com/swig/swig
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:
parent
ea8aa84b28
commit
4be9274c82
|
@ -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;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue