aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/stdio/ungetc.c
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2004-03-10 12:41:11 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2004-03-10 12:41:11 +0000
commit85fa6736d86dba959d2a3922d6da31d39548ca16 (patch)
tree512f2612cd3559aa2fa45a754fe0fa30cb1989e2 /lib/libc/stdio/ungetc.c
parent4124f7c0137f862b027ab8018d2faceeeb38ad33 (diff)
downloadsrc-85fa6736d86dba959d2a3922d6da31d39548ca16.tar.gz
src-85fa6736d86dba959d2a3922d6da31d39548ca16.zip
Set stream orientation in ungetc() instead of __ungetc(). This avoids
setting it redundantly when called from ungetwc(), vfscanf() etc., which already set the orientation.
Notes
Notes: svn path=/head/; revision=126809
Diffstat (limited to 'lib/libc/stdio/ungetc.c')
-rw-r--r--lib/libc/stdio/ungetc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libc/stdio/ungetc.c b/lib/libc/stdio/ungetc.c
index 9ede08360ce9..01131619d63a 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) {