From 00bce96751f596b35d40040da47acb09d9b684aa Mon Sep 17 00:00:00 2001 From: tjr Date: Wed, 10 Mar 2004 12:41:11 +0000 Subject: Set stream orientation in ungetc() instead of __ungetc(). This avoids setting it redundantly when called from ungetwc(), vfscanf() etc., which already set the orientation. --- lib/libc/stdio/ungetc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/libc') 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) { -- cgit v1.1