Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
(_IO_new_file_seekoff): If mode is 0 and fp->_offset == _IO_pos_BAD, …
…just call _IO_SYSSEEK (fp, 0, dir) and if successful set fp->_offset.
  • Loading branch information
Ulrich Drepper committed Nov 9, 2004
1 parent 936668d commit eca2972
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion libio/fileops.c
Expand Up @@ -989,7 +989,18 @@ _IO_new_file_seekoff (fp, offset, dir, mode)
/* Adjust for read-ahead (bytes is buffer). */
offset -= fp->_IO_read_end - fp->_IO_read_ptr;
if (fp->_offset == _IO_pos_BAD)
goto dumb;
{
if (mode != 0)
goto dumb;
else
{
result = _IO_SYSSEEK (fp, 0, dir);
if (result == EOF)
return result;

fp->_offset = result;
}
}
/* Make offset absolute, assuming current pointer is file_ptr(). */
offset += fp->_offset;
if (offset < 0)
Expand Down

0 comments on commit eca2972

Please sign in to comment.