changeset 15513:3ae8c1ee7365

maint: periodic merge of stable to default
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Fri, 12 Oct 2012 11:46:06 -0400
parents f0dfdc7faa71 (current diff) dcd6fa8d3da2 (diff)
children 7a0a202fedfe
files doc/interpreter/contrib.txi etc/HACKING etc/README.MacOS etc/README.MinGW libinterp/interp-core/zfstream.cc libinterp/version.in.h scripts/help/unimplemented.m scripts/miscellaneous/info.m scripts/plot/subplot.m
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/interp-core/zfstream.cc
+++ b/libinterp/interp-core/zfstream.cc
@@ -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)