From 00bc5db059212a20afb42da40b38d7f145a46dfd Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 18 Sep 1998 17:59:03 +0000 Subject: Update. 1998-09-18 17:41 Ulrich Drepper * libio/fileops.c (_IO_new_file_underflow): Before allocating buffer make sure the pushback buffer is destroyed. (_IO_new_file_seekoff): Likewise. If mode==0 quit early with the result. Clear OEF flag after successful fseek. * libio/libio.h (_IO_FILE_complete): Add _IO_save_ptr. * libio/ftello.c (ftello): Add offset from original buffer if stream has pushed back characters. * libio/ftello64.c (ftello64): Likewise. * libio/iofgetpos.c (_IO_fgetpos): Likewise. * libio/iofgetpos64.c (_IO_fgetpos64): Likewise. * libio/ioftell.c (_IO_ftell): Likewise. * libio/genops.c (_IO_switch_to_main_get_area): Swap _IO_read_ptr and _IO_save_ptr. (_IO_switch_to_backup_area): Save _IO_read_ptr in _IO_save_ptr. (_IO_default_pbackfail): Only stored push back character in original buffer if it is the same as the one in the file at this position. * libio/iofclose.c: Free backup buffer if one is available. * libio/ioseekoff.c (_IO_seekoff): Only remove pushback buffer if mode!=0. * strdlib/strtol.c (strtol): Handle 0x... string for base!=0 correctly. * time/strftime.c [_LIBC] (ampm): Use tp->tm_hour not hour12. 1998-09-18 Mark Kettenis * login/programs/pt_chown.c (more_help): Correct message that describes the purpose of the program. * login/openpty.c: Do not include pty-private.h. (pts_name): New function. Return name of slave pseudo terminal in an allocated buffer if necessary. (openpty): Use pts_name to get name of the slave end of the pseudo terminal pair. * sysdeps/unix/grantpt.c (grantpt): Free buffer allocated by pts_name before return. 1998-09-18 11:15 Ulrich Drepper * math/math.h: Define __NO_MATH_INLINES if __STRICT_ANSI__. --- libio/ioftell.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libio/ioftell.c') diff --git a/libio/ioftell.c b/libio/ioftell.c index 3a0e7a6..3de1ee9 100644 --- a/libio/ioftell.c +++ b/libio/ioftell.c @@ -36,6 +36,8 @@ _IO_ftell (fp) _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp); _IO_flockfile (fp); pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0); + if (_IO_in_backup (fp)) + pos -= fp->_IO_save_end - fp->_IO_save_base; _IO_funlockfile (fp); _IO_cleanup_region_end (0); if (pos == _IO_pos_BAD) -- cgit v1.1