diff --git a/src/internal/shgetc.c b/src/internal/shgetc.c index 96f72b6ab476fb65b14ca54db460241ece857ecb..e878b00ad50ac709b33366f11619817c1e535636 100644 --- a/src/internal/shgetc.c +++ b/src/internal/shgetc.c @@ -22,5 +22,6 @@ int __shgetc(FILE *f) else f->shend = f->rend; if (f->rend) f->shcnt += f->rend - f->rpos + 1; + if (f->rpos[-1] != c) f->rpos[-1] = c; return c; }