From: curt Date: Wed, 2 Jun 1999 22:22:47 +0000 (+0000) Subject: Mac portability changes contributed by "Darrell Walisser" X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8f0f79506cbca0d3d5ead205918ffc40b8776413;p=simgear.git Mac portability changes contributed by "Darrell Walisser" --- 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 != '#' )