strip trailing spaces & garbage
This commit is contained in:
parent
639ed2161f
commit
72eecef8fa
1 changed files with 5 additions and 3 deletions
|
@ -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 << " '"
|
||||
|
|
Loading…
Reference in a new issue