From 72eecef8faf19734e824bdd042a0c49ffd234217 Mon Sep 17 00:00:00 2001 From: mfranz Date: Mon, 13 Jun 2005 19:27:40 +0000 Subject: [PATCH] strip trailing spaces & garbage --- src/Main/options.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Main/options.cxx b/src/Main/options.cxx index b27f37843..c1e5ae46d 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -1535,9 +1535,11 @@ fgParseOptions (const string& path) { #endif // catch extraneous (DOS) line ending character - if ( line[line.length() - 1] < 32 ) { - line = line.substr( 0, line.length()-1 ); - } + int i; + for (i = line.length(); i > 0; i--) + if (line[i - 1] > 32) + break; + line = line.substr( 0, i ); if ( parse_option( line ) == FG_OPTIONS_ERROR ) { cerr << endl << "Config file parse error: " << path << " '" -- 2.39.5