diff options
author | tjr <tjr@FreeBSD.org> | 2004-03-10 12:41:11 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2004-03-10 12:41:11 +0000 |
commit | 00bce96751f596b35d40040da47acb09d9b684aa (patch) | |
tree | 512f2612cd3559aa2fa45a754fe0fa30cb1989e2 /lib/libc/stdio/ungetc.c | |
parent | 76708e58aa9dc399b400d44b43ebe494b69837c1 (diff) | |
download | FreeBSD-src-00bce96751f596b35d40040da47acb09d9b684aa.zip FreeBSD-src-00bce96751f596b35d40040da47acb09d9b684aa.tar.gz |
Set stream orientation in ungetc() instead of __ungetc(). This avoids
setting it redundantly when called from ungetwc(), vfscanf() etc.,
which already set the orientation.
Diffstat (limited to 'lib/libc/stdio/ungetc.c')
-rw-r--r-- | lib/libc/stdio/ungetc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libc/stdio/ungetc.c b/lib/libc/stdio/ungetc.c index 9ede083..0113161 100644 --- a/lib/libc/stdio/ungetc.c +++ b/lib/libc/stdio/ungetc.c @@ -99,6 +99,7 @@ ungetc(int c, FILE *fp) if (!__sdidinit) __sinit(); FLOCKFILE(fp); + ORIENT(fp, -1); ret = __ungetc(c, fp); FUNLOCKFILE(fp); return (ret); @@ -111,8 +112,6 @@ int __ungetc(int c, FILE *fp) { - ORIENT(fp, -1); - if (c == EOF) return (EOF); if ((fp->_flags & __SRD) == 0) { |