Skip to content

Commit

Permalink
fix #14469
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Mar 11, 2024
1 parent d33d119 commit 3737b7b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 7 additions & 5 deletions src/netedit/tools/GNENetDiffTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,21 @@ GNENetDiffTool::getCommand() const {
sumoHome = std::string(sumoHomeEnv);
// harmonise slash
if (sumoHome.back() == '\\') {
sumoHome = sumoHome.substr(0, sumoHome.size() - 1);
sumoHome.pop_back();
}
if (sumoHome.back() != '/') {
sumoHome += "/";
}
// quote string to handle spaces but prevent double quotes
if (sumoHome.front() != '"') {
sumoHome = "\"" + sumoHome;
}
if (sumoHome.back() != '"') {
sumoHome += "\"";
if (sumoHome.back() == '"') {
sumoHome.pop_back();
}
sumoHome += "/";
}
// get command
std::string command = python + " " + sumoHome + myToolPath;
std::string command = python + " " + sumoHome + myToolPath + "\"";
// declare arguments
std::string arguments;
// add arguments
Expand Down
12 changes: 7 additions & 5 deletions src/netedit/tools/GNEPythonTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,21 @@ GNEPythonTool::getCommand() const {
sumoHome = std::string(sumoHomeEnv);
// harmonise slash
if (sumoHome.back() == '\\') {
sumoHome = sumoHome.substr(0, sumoHome.size() - 1);
sumoHome.pop_back();
}
if (sumoHome.back() != '/') {
sumoHome += "/";
}
// quote string to handle spaces but prevent double quotes
if (sumoHome.front() != '"') {
sumoHome = "\"" + sumoHome;
}
if (sumoHome.back() != '"') {
sumoHome += "\"";
if (sumoHome.back() == '"') {
sumoHome.pop_back();
}
sumoHome += "/";
}
// get command
std::string command = python + " " + sumoHome + myToolPath;
std::string command = python + " " + sumoHome + myToolPath + "\"";
// declare arguments
std::string arguments;
// add arguments
Expand Down

0 comments on commit 3737b7b

Please sign in to comment.