# HG changeset patch # User Benjamin Lindner # Date 1237460270 14400 # Node ID af43309a59f40209aaa58c1e5a6901acc4b3845d # Parent 1b097d86a61a6ccd28337bc4699e260d8f34911d fix leaving stray '\r' in stream when reading from CRLF data file diff -r 1b097d86a61a -r af43309a59f4 src/ChangeLog --- a/src/ChangeLog Wed Mar 18 16:17:15 2009 +0100 +++ b/src/ChangeLog Thu Mar 19 06:57:50 2009 -0400 @@ -1,3 +1,9 @@ +2009-03-19 Benjamin Lindner + + * ls-oct-ascii.cc (extract_keyword): Replace loop with call to + read_until_newline to avoid leaving stray '\r' in stream when + reading files with CRLF line endings. + 2009-03-18 Jaroslav Hajek * DLD-FUNCTIONS/cellfun.cc diff -r 1b097d86a61a -r af43309a59f4 src/ls-oct-ascii.cc --- a/src/ls-oct-ascii.cc Wed Mar 18 16:17:15 2009 +0100 +++ b/src/ls-oct-ascii.cc Thu Mar 19 06:57:50 2009 -0400 @@ -110,14 +110,8 @@ while (is.get (c) && (c == ' ' || c == '\t' || c == ':')) ; // Skip whitespace and the colon. - if (c != '\n' && c != '\r') - { - value << c; - while (is.get (c) && c != '\n' && c != '\r') - value << c; - } - - retval = value.str (); + is.putback(c); + retval = read_until_newline (is, false); break; } else if (next_only)