Skip to content
Snippets Groups Projects
Commit b1d154dc authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

escape exe name to allow exe path with white space

parent 9a8a0baa
No related branches found
No related tags found
No related merge requests found
......@@ -899,14 +899,13 @@ void Msg::LoadOnelabClient(const std::string &clientName, const std::string &soc
{
#if defined(HAVE_ONELAB)
onelab::remoteNetworkClient *client = 0;
client = new onelab::remoteNetworkClient(clientName,sockName);
client = new onelab::remoteNetworkClient(clientName, sockName);
if(client){
std::string action, cmd;
std::vector<onelab::string> ps;
client->get(ps,clientName+"/Action");
if(ps.size() && ps[0].getValue().size())
action.assign(ps[0].getValue());
//cmd.assign("");
if(!action.compare("compute")){
std::vector<onelab::string> ps;
......@@ -915,14 +914,14 @@ void Msg::LoadOnelabClient(const std::string &clientName, const std::string &soc
cmd.assign(ps[0].getValue());
if(cmd.size()){
Msg::Info("Loader calls <%s>",cmd.c_str());
//client->sendInfo(strcat("Loader calls",cmd.c_str()));
std::cout << "Loader calls " << cmd << std::endl;
SystemCall(cmd.c_str(),true); //true->blocking
Msg::Info("Loader calls <%s>", cmd.c_str());
//client->sendInfo(strcat("Loader calls",cmd.c_str()));
std::cout << "Loader calls " << cmd << std::endl;
SystemCall(cmd.c_str(), true); //true->blocking
}
else
Msg::Info("No full command line found for <%s>",
clientName.c_str());
Msg::Info("No full command line found for <%s>",
clientName.c_str());
}
Msg::Info("Stopping client <%s>", clientName.c_str());
delete client;
......
......@@ -111,8 +111,10 @@ class onelabGmshServer : public GmshServer{
sockname = tmp.str();
}
std::string command = FixWindowsPath(_client->getExecutable());
if(command.size()){
std::string exe = FixWindowsPath(_client->getExecutable());
std::string command;
if(exe.size()){
command.append("\"" + exe + "\"");
std::vector<std::string> args = onelabUtils::getCommandLine(_client);
for(unsigned int i = 0; i < args.size(); i++)
command.append(" " + args[i]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment