about summary refs log tree commit diff
path: root/libio/iofgetpos.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/iofgetpos.c')
-rw-r--r--libio/iofgetpos.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libio/iofgetpos.c b/libio/iofgetpos.c
index 5fed6c3685..27f018d07f 100644
--- a/libio/iofgetpos.c
+++ b/libio/iofgetpos.c
@@ -36,6 +36,8 @@ _IO_fgetpos (fp, posp)
   _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)