Skip to content

Commit 38a6221

Browse files
DorianGerardinArthoni
authored andcommitted
Fix of space in process path
(references #1291) (co-authored-by: Armel Thöni)
1 parent e2d36c7 commit 38a6221

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CMake.in.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ SET(OFBUILD_CUSTOM_CMAKE_VERSION "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.
2323
SET(OPENFLUID_VERSION_MAJOR 2)
2424
SET(OPENFLUID_VERSION_MINOR 2)
2525
SET(OPENFLUID_VERSION_PATCH 0)
26-
SET(OPENFLUID_VERSION_STATUS "beta3") # example: SET(OPENFLUID_VERSION_STATUS "rc1")
26+
SET(OPENFLUID_VERSION_STATUS "beta4") # example: SET(OPENFLUID_VERSION_STATUS "rc1")
2727

2828
SET(OPENFLUID_VERSION_FULL "${OPENFLUID_VERSION_MAJOR}.${OPENFLUID_VERSION_MINOR}.${OPENFLUID_VERSION_PATCH}")
2929

src/openfluid/fluidx/SpatialDomainDescriptor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ void SpatialDomainDescriptor::addUnit(const openfluid::fluidx::SpatialUnitDescri
312312
{
313313
throw openfluid::base::FrameworkException(OPENFLUID_CODE_LOCATION,
314314
"unable to add spatial unit " +
315-
openfluid::tools::classIDToString(ClassName,ID) + "that already exists");
315+
openfluid::tools::classIDToString(ClassName,ID) + " that already exists");
316316
}
317317

318318
auto itInserted = (m_SpatialUnits[ClassName].insert(std::make_pair(ID, UnitDesc))).first;

src/openfluid/utils/Process.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,13 @@ bool Process::run()
169169
{
170170
WorkDir = m_Cmd.WorkDir;
171171
}
172-
boost::process::child BPC(boost::process::exe = m_Cmd.Program,
172+
std::string Program = m_Cmd.Program;
173+
// Process with space must be surrounded by quotes (works for windows and linux)
174+
if ((Program.find(' ') != std::string::npos) && (Program[0] != '"'))
175+
{
176+
Program = "\""+Program+"\"";
177+
}
178+
boost::process::child BPC(boost::process::exe = Program,
173179
boost::process::args = m_Cmd.Args,
174180
boost::process::start_dir = WorkDir,
175181
boost::process::std_out > StdOutStr, boost::process::std_err > StdErrStr,

0 commit comments

Comments
 (0)