From 8f0f79506cbca0d3d5ead205918ffc40b8776413 Mon Sep 17 00:00:00 2001 From: curt Date: Wed, 2 Jun 1999 22:22:47 +0000 Subject: [PATCH] Mac portability changes contributed by "Darrell Walisser" --- Lib/Misc/fgstream.cxx | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/Lib/Misc/fgstream.cxx b/Lib/Misc/fgstream.cxx index 830154c2..01b2c230 100644 --- a/Lib/Misc/fgstream.cxx +++ b/Lib/Misc/fgstream.cxx @@ -95,12 +95,11 @@ skipeol( istream& in ) { char c = 0; // skip to end of line. - while ( in.get(c) && (c != '\n' && c != '\r') ) - ; - - #ifdef __MWERKS // -dw- need to strip line ending! - in >> skipws; - #endif + while ( in.get(c) ) { + if ( (c == '\n') || (c == '\r') ) { + break; + } + } return in; } @@ -109,11 +108,15 @@ istream& skipws( istream& in ) { char c; while ( in.get(c) ) { - #ifdef __MWERKS__ // -dw- for unix file compatibility - if ( ! (isspace( c ) ) || c != '\0' || c!='\n' || c != '\r' ) { - #else - if ( ! isspace( c ) ) { + // -dw- for unix file compatibility + // -clo- this causes problems for unix + #ifdef __MWERKS__ + if ( (c == '\n') || (c == '\r') ) { + break; + } #endif + + if ( ! isspace( c ) ) { // put pack the non-space character in.putback(c); break; @@ -128,7 +131,11 @@ skipcomment( istream& in ) while ( in ) { // skip whitespace +#ifdef __MWERKS__ + in >> ::skipws; +#else in >> skipws; +#endif char c; if ( in.get( c ) && c != '#' ) -- 2.39.5