X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FNetwork%2Fprops.cxx;h=3692a5cfe6ec49fed2c8197df9d5c780b1b61c99;hb=7d3448294bc7486af3f4c1f0ff5c8493b03ffc90;hp=3dcc682002f227bee62ce743f1476794fa40c711;hpb=0cc3bed841c8b75d6fe48705a3589a8bb500c609;p=flightgear.git diff --git a/src/Network/props.cxx b/src/Network/props.cxx index 3dcc68200..3692a5cfe 100644 --- a/src/Network/props.cxx +++ b/src/Network/props.cxx @@ -203,7 +203,7 @@ bool FGProps::process_command( const char *cmd ) { } } else if ( command == "pwd" ) { string ttt = node->getPath(); - if ( ttt == "" ) { + if ( ttt.empty() ) { ttt = "/"; } ttt += "\n"; @@ -215,9 +215,6 @@ bool FGProps::process_command( const char *cmd ) { string tmp; string value = node->getStringValue ( tokens[1].c_str(), "" ); if ( mode == PROMPT ) { - //string ttt = "debug = '" + tokens[1] + "'\n"; - //io->writestring( ttt.c_str() ); - tmp = tokens[1] + " = '" + value + "' ("; tmp += getValueTypeString( node->getNode( tokens[1].c_str() ) ); tmp += ")\n"; @@ -230,16 +227,22 @@ bool FGProps::process_command( const char *cmd ) { if ( tokens.size() <= 2 ) { // do nothing } else { - node->getNode( tokens[1].c_str(), true )->setStringValue(tokens[2].c_str()); + string tmp = tokens[2]; + for ( unsigned int i = 3; i < tokens.size() - 1; i++ ) { + tmp += " " + tokens[i]; + } + node->getNode( tokens[1].c_str(), true )->setStringValue(tmp.c_str()); - // now fetch and write out the new value as confirmation - // of the change - string value = node->getStringValue ( tokens[1].c_str(), "" ); - string tmp = tokens[1] + " = '" + value + "' ("; - tmp += getValueTypeString( node->getNode( tokens[1].c_str() ) ); - tmp += ")\n"; - - io->writestring( tmp.c_str() ); + if ( mode == PROMPT ) { + // now fetch and write out the new value as confirmation + // of the change + string value = node->getStringValue ( tokens[1].c_str(), "" ); + string tmp = tokens[1] + " = '" + value + "' ("; + tmp += getValueTypeString( node->getNode( tokens[1].c_str() ) ); + tmp += ")\n"; + + io->writestring( tmp.c_str() ); + } } } else if ( command == "quit" ) { close(); @@ -269,7 +272,7 @@ bool FGProps::process_command( const char *cmd ) { if ( mode == PROMPT ) { string prompt = node->getPath(); - if ( prompt == "" ) { + if ( prompt.empty() ) { prompt = "/"; } prompt += "> ";