# HG changeset patch # User John W. Eaton # Date 1220892353 14400 # Node ID 4c67385043664a54fc7f1fa9949510266dfe105d # Parent 4b36e0cc57ed20f32010b54146b2671c759eeb28 ls-oct-ascii.{h,cc} (extract_keyword): accept \r as line ending character diff -r 4b36e0cc57ed -r 4c6738504366 src/ChangeLog --- a/src/ChangeLog Mon Sep 08 10:49:46 2008 -0400 +++ b/src/ChangeLog Mon Sep 08 12:45:53 2008 -0400 @@ -1,3 +1,12 @@ +2008-09-08 John W. Eaton + + * ls-oct-ascii.cc (std::string extract_keyword (std::istream&, + const char *, const bool)): Also accept \r as line ending character. + * ls-oct-ascii.h (template bool extract_keyword + (std::istream&, const char *, T&, const bool)): Likewise. + (template bool extract_keyword (std::istream&, const + string_vector&, std::string&, T&, const bool)): Likewise. + 2008-08-27 Jaroslav Hajek * DLD-FUNCTIONS/__glpk__.cc (F__glpk__): Initialize output vectors diff -r 4b36e0cc57ed -r 4c6738504366 src/ls-oct-ascii.cc --- a/src/ls-oct-ascii.cc Mon Sep 08 10:49:46 2008 -0400 +++ b/src/ls-oct-ascii.cc Mon Sep 08 12:45:53 2008 -0400 @@ -108,10 +108,10 @@ while (is.get (c) && (c == ' ' || c == '\t' || c == ':')) ; // Skip whitespace and the colon. - if (c != '\n') + if (c != '\n' && c != '\r') { value << c; - while (is.get (c) && c != '\n') + while (is.get (c) && c != '\n' && c != '\r') value << c; } @@ -122,7 +122,7 @@ break; else { - while (is.get (c) && c != '\n') + while (is.get (c) && c != '\n' && c != '\r') ; // Skip to end of line. } } diff -r 4b36e0cc57ed -r 4c6738504366 src/ls-oct-ascii.h --- a/src/ls-oct-ascii.h Mon Sep 08 10:49:46 2008 -0400 +++ b/src/ls-oct-ascii.h Mon Sep 08 12:45:53 2008 -0400 @@ -99,11 +99,11 @@ ; // Skip whitespace and the colon. is.putback (c); - if (c != '\n') + if (c != '\n' && c != '\r') is >> value; if (is) status = true; - while (is.get (c) && c != '\n') + while (is.get (c) && c != '\n' && c != '\r') ; // Skip to beginning of next line; break; } @@ -161,11 +161,11 @@ ; // Skip whitespace and the colon. is.putback (c); - if (c != '\n') + if (c != '\n' && c != '\r') is >> value; if (is) status = true; - while (is.get (c) && c != '\n') + while (is.get (c) && c != '\n' && c != '\r') ; // Skip to beginning of next line; return status; }