about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-10-23 10:38:06 +0000
committerUlrich Drepper <drepper@redhat.com>1998-10-23 10:38:06 +0000
commitd6787ff2579c3ffa48219027498ed8aca3e19fc4 (patch)
treebf66a28dd09830ae0d26e56a41e1e483d8e55491
parent983936601be5abfe16b36ef8a76ca8121d1d98d7 (diff)
downloadglibc-d6787ff2579c3ffa48219027498ed8aca3e19fc4.tar.gz
glibc-d6787ff2579c3ffa48219027498ed8aca3e19fc4.tar.xz
glibc-d6787ff2579c3ffa48219027498ed8aca3e19fc4.zip
Update.
1998-10-23  Ulrich Drepper  <drepper@cygnus.com>

	* libio/genops.c (_IO_seekmark): When switching to backup buffer
	make sure all characters from the read buffer are read after
	switching back to it.
-rw-r--r--ChangeLog6
-rw-r--r--libio/genops.c7
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6eab21a2f0..a2f3c66c43 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1998-10-23  Ulrich Drepper  <drepper@cygnus.com>
+
+	* libio/genops.c (_IO_seekmark): When switching to backup buffer
+	make sure all characters from the read buffer are read after
+	switching back to it.
+
 1998-10-22  Ulrich Drepper  <drepper@cygnus.com>
 
 	* configure.in: Add support for Cygnus GNUPro compilers.
diff --git a/libio/genops.c b/libio/genops.c
index c75be6234b..b1ccb289b3 100644
--- a/libio/genops.c
+++ b/libio/genops.c
@@ -94,7 +94,7 @@ _IO_switch_to_main_get_area (fp)
   tmp = fp->_IO_read_base;
   fp->_IO_read_base = fp->_IO_save_base;
   fp->_IO_save_base = tmp;
-  /* Swap _IO_read_base and _IO_save_ptr. */
+  /* Swap _IO_read_ptr and _IO_save_ptr. */
   tmp = fp->_IO_read_ptr;
   fp->_IO_read_ptr = fp->_IO_save_ptr;
   fp->_IO_save_ptr = tmp;
@@ -817,7 +817,10 @@ _IO_seekmark (fp, mark, delta)
   else
     {
       if (!_IO_in_backup (fp))
-	_IO_switch_to_backup_area (fp);
+	{
+	  fp->_IO_read_ptr = fp->_IO_read_base;
+	  _IO_switch_to_backup_area (fp);
+	}
       fp->_IO_read_ptr = fp->_IO_read_end + mark->_pos;
     }
   return 0;