# HG changeset patch # User John W. Eaton # Date 1220892353 14400 # Node ID 7d19f4f70c613ca006e7062a4dba82b5a7c20a8d # Parent 83646120b54c9c69b831236c65e32e2fb37c03fd ls-oct-ascii.{h,cc} (extract_keyword): accept \r as line ending character diff -r 83646120b54c -r 7d19f4f70c61 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-09-03 Ben Abbott * mappers.cc: Use eps(single) as tolerance for single precesion test. diff -r 83646120b54c -r 7d19f4f70c61 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 @@ -110,10 +110,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; } @@ -124,7 +124,7 @@ break; else { - while (is.get (c) && c != '\n') + while (is.get (c) && c != '\n' && c != '\r') ; // Skip to end of line. } } diff -r 83646120b54c -r 7d19f4f70c61 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; }