Formerly ../stdio/fseek.c.~21~
authorroland <roland>
Fri, 2 Oct 1992 22:08:42 +0000 (22:08 +0000)
committerroland <roland>
Fri, 2 Oct 1992 22:08:42 +0000 (22:08 +0000)
stdio/fseek.c

index 47a7a17..999a954 100644 (file)
@@ -50,6 +50,13 @@ DEFUN(fseek, (stream, offset, whence),
   if (__stdio_check_offset(stream) == EOF)
     return EOF;
 
+  if (stream->__pushed_back)
+    {
+      /* Discard the character pushed back by ungetc.  */
+      stream->__bufp = stream->__pushback_bufp;
+      stream->__pushed_back = 0;
+    }
+
   /* Check the WHENCE argument for validity, and process OFFSET
      into an absolute position in O.  By the end of this switch,
      either we have returned, or O contains an absolute position.  */