summaryrefslogtreecommitdiff
path: root/lib/libc/stdio/ungetc.c
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2001-08-31 19:50:25 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2001-08-31 19:50:25 +0000
commit4db40fd14364aeb459a7ea4b98b30bdf35a441cb (patch)
tree03e8d35d661564b0014d83106e783bad71d87258 /lib/libc/stdio/ungetc.c
parent7cf30ace8422d718f3823fcdecf7fc5a2fd67772 (diff)
Notes
Diffstat (limited to 'lib/libc/stdio/ungetc.c')
-rw-r--r--lib/libc/stdio/ungetc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libc/stdio/ungetc.c b/lib/libc/stdio/ungetc.c
index f70fb425bb17..092debd5b4e6 100644
--- a/lib/libc/stdio/ungetc.c
+++ b/lib/libc/stdio/ungetc.c
@@ -132,6 +132,10 @@ __ungetc(int c, FILE *fp)
}
fp->_flags |= __SRD;
}
+
+ if (!(fp->_flags & __SSTR) && _ftello(fp) == 0)
+ return (EOF);
+
c = (unsigned char)c;
/*