summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/internal/shgetc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/internal/shgetc.c b/src/internal/shgetc.c
index 96f72b6a..e878b00a 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;
}