X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Foptions.cxx;h=b4a3bc830f01596d1678689f0b6c07bc48456a3e;hb=38226af24ec01e8f0a20d7fd73ef838a69f6ef25;hp=bce7fdeb9c00180ee682fc4485dda7ae6322f5e8;hpb=e5fb1f281fa7ac5ca54fcfd722a487fae9df70b7;p=flightgear.git diff --git a/src/Main/options.cxx b/src/Main/options.cxx index bce7fdeb9..b4a3bc830 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -900,10 +901,16 @@ fgOptStartDateGmt( const char *arg ) static int fgSetupProxy( const char *arg ) { - string options = arg; + string options = simgear::strutils::strip( arg ); string host, port, auth; string::size_type pos; + // this is NURLP - NURLP is not an url parser + if( simgear::strutils::starts_with( options, "http://" ) ) + options = options.substr( 7 ); + if( simgear::strutils::ends_with( options, "/" ) ) + options = options.substr( 0, options.length() - 1 ); + host = port = auth = ""; if ((pos = options.find("@")) != string::npos) auth = options.substr(0, pos++);