Set stream orientation in ungetc() instead of __ungetc(). This avoids

setting it redundantly when called from ungetwc(), vfscanf() etc.,
which already set the orientation.
This commit is contained in:
Tim J. Robbins 2004-03-10 12:41:11 +00:00
parent 4124f7c013
commit 85fa6736d8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=126809

View File

@ -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) {