Mercurial > octave-nkf
comparison src/ov-range.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 | a1dbe9d80eee |
children |
comparison
equal
deleted
inserted
replaced
11943:af4fa72ee250 | 11944:278afaecddd4 |
---|---|
39 #include "pr-output.h" | 39 #include "pr-output.h" |
40 | 40 |
41 #include "byte-swap.h" | 41 #include "byte-swap.h" |
42 #include "ls-hdf5.h" | 42 #include "ls-hdf5.h" |
43 #include "ls-utils.h" | 43 #include "ls-utils.h" |
44 #include "ls-ascii-helper.h" | |
44 | 45 |
45 DEFINE_OCTAVE_ALLOCATOR (octave_range); | 46 DEFINE_OCTAVE_ALLOCATOR (octave_range); |
46 | 47 |
47 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_range, "range", "double"); | 48 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_range, "range", "double"); |
48 | 49 |
272 ; // Skip whitespace on way to beginning of next line. | 273 ; // Skip whitespace on way to beginning of next line. |
273 else | 274 else |
274 break; | 275 break; |
275 } | 276 } |
276 | 277 |
277 for (;;) | 278 // Skip to beginning of next line, ignoring everything. |
278 { | 279 skip_until_newline (is, false); |
279 if (is && (c == '%' || c == '#')) | 280 |
280 while (is.get (c) && c != '\n') | |
281 ; // Skip to beginning of next line, ignoring everything. | |
282 else | |
283 break; | |
284 } | |
285 } | 281 } |
286 | 282 |
287 bool | 283 bool |
288 octave_range::save_ascii (std::ostream& os) | 284 octave_range::save_ascii (std::ostream& os) |
289 { | 285 { |