diff --git a/include/SWI-Stream.h b/include/SWI-Stream.h index d8ae028f3..ca3f5c04e 100644 --- a/include/SWI-Stream.h +++ b/include/SWI-Stream.h @@ -224,9 +224,12 @@ PL_EXPORT_DATA(IOSTREAM) S__iob[3]; /* Libs standard streams */ #define Sgetchar() Sgetc(Sinput) #define Sputchar(c) Sputc((c), Soutput) +#define S__checkpasteeof(s,c) \ + if ( (c)==-1 && (s)->flags & (SIO_FEOF|SIO_FERR) ) \ + ((s)->flags |= SIO_FEOF2) #define S__updatefilepos_getc(s, c) \ ((s)->position ? S__fupdatefilepos_getc((s), (c)) \ - : (c)) + : S__fcheckpasteeof((s), (c))) #define Snpgetc(s) ((s)->bufp < (s)->limitp ? (int)(*(s)->bufp++)&0xff \ : S__fillbuf(s))