changeset 8996:af43309a59f4

fix leaving stray '\r' in stream when reading from CRLF data file
author Benjamin Lindner <lindnerb@users.sourceforge.net>
date Thu, 19 Mar 2009 06:57:50 -0400
parents 1b097d86a61a
children 187a9d9c2f04
files src/ChangeLog src/ls-oct-ascii.cc
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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  <lindnerb@users.sourceforge.net>
+
+	* 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 <highegg@gmail.com>
 
 	* DLD-FUNCTIONS/cellfun.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)