diff src/oct-stream.cc @ 7538:2c4b0cbda85a

oct-stream.cc (do_read): stop reading if seek fails
author John W. Eaton <jwe@octave.org>
date Wed, 27 Feb 2008 22:47:58 -0500
parents 402168152bb9
children fa41af732801
line wrap: on
line diff
--- a/src/oct-stream.cc	Wed Feb 27 04:33:39 2008 -0500
+++ b/src/oct-stream.cc	Wed Feb 27 22:47:58 2008 -0500
@@ -3139,13 +3139,15 @@
 		  elts_read++;
 		}
 
+	      int seek_status = 0;
+
 	      if (skip != 0 && elts_read == block_size)
 		{
-		  strm.seek (skip, SEEK_CUR);
+		  seek_status = strm.seek (skip, SEEK_CUR);
 		  elts_read = 0;
 		}
 
-	      if (is.eof ())
+	      if (is.eof () || seek_status < 0)
 		{
 		  if (nr > 0)
 		    {