Mercurial > octave-nkf
comparison 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 |
comparison
equal
deleted
inserted
replaced
11943:af4fa72ee250 | 11944:278afaecddd4 |
---|---|
904 { | 904 { |
905 i++; | 905 i++; |
906 | 906 |
907 std::ios::openmode mode = std::ios::in; | 907 std::ios::openmode mode = std::ios::in; |
908 | 908 |
909 if (format == LS_BINARY | 909 // Open in binary mode in any case, to fix annoying bug that |
910 #ifdef HAVE_HDF5 | 910 // text-mode opened streams cannot be seekg'ed/tellg'ed with |
911 || format == LS_HDF5 | 911 // mingw32 (See http://oldwiki.mingw.org/index.php/Known%20Problems ) |
912 #endif | 912 // The CR/LF issues are handled in ls-ascii-helper.cc |
913 || format == LS_MAT_BINARY | 913 mode |= std::ios::binary; |
914 || format == LS_MAT5_BINARY | 914 |
915 || format == LS_MAT7_BINARY) | |
916 mode |= std::ios::binary; | |
917 | |
918 #ifdef HAVE_ZLIB | 915 #ifdef HAVE_ZLIB |
919 if (use_zlib) | 916 if (use_zlib) |
920 { | 917 { |
921 gzifstream file (fname.c_str (), mode); | 918 gzifstream file (fname.c_str (), mode); |
922 | 919 |