diff src/load-save.cc @ 11944:278afaecddd4 release-3-0-x

fix leaving stray '\r' in stream when reading from CRLF data file * * * fix CRLF issues with text-mode reading in windows when loading ascii data
author Benjamin Lindner <lindnerb@users.sourceforge.net>
date Wed, 18 Mar 2009 15:23:14 +0100
parents 63380109b520
children
line wrap: on
line diff
--- a/src/load-save.cc	Thu Mar 26 07:29:25 2009 +0100
+++ b/src/load-save.cc	Wed Mar 18 15:23:14 2009 +0100
@@ -906,15 +906,12 @@
 
 	  std::ios::openmode mode = std::ios::in;
 
-	  if (format == LS_BINARY
-#ifdef HAVE_HDF5
-	      || format == LS_HDF5
-#endif
-	      || format == LS_MAT_BINARY
-	      || format == LS_MAT5_BINARY
-	      || format == LS_MAT7_BINARY)
-	    mode |= std::ios::binary;
-
+	  // Open in binary mode in any case, to fix annoying bug that
+	  // text-mode opened streams cannot be seekg'ed/tellg'ed with
+	  // mingw32 (See http://oldwiki.mingw.org/index.php/Known%20Problems )
+	  // The CR/LF issues are handled in ls-ascii-helper.cc
+	  mode |= std::ios::binary;
+	  
 #ifdef HAVE_ZLIB
 	  if (use_zlib)
 	    {