changeset 15511:dcd6fa8d3da2 stable

Merge in Mike's changes
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Fri, 12 Oct 2012 11:42:25 -0400
parents c1c5b3cc2996 (diff) 623cce4577b3 (current diff)
children 3ae8c1ee7365 7f7a07657be4
files
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/zfstream.cc	Wed Oct 10 11:31:41 2012 -0700
+++ b/src/zfstream.cc	Fri Oct 12 11:42:25 2012 -0400
@@ -473,6 +473,11 @@
       if ((io_mode & std::ios_base::in) && way == std::ios_base::cur)
         computed_off += this->gptr() - this->egptr();
 
+      // Handle tellg/tellp as a special case up front, no need to seek
+      // or invalidate get/put buffers
+      if (off == 0 && way == std::ios_base::cur)
+        return pos_type (gztell (file) + computed_off);
+
       if (way == std::ios_base::beg)
         ret = pos_type (gzseek (file, computed_off, SEEK_SET));
       else if (way == std::ios_base::cur)