From e2bf95ff77be8a0dbe03d32ae142f931efaa152a Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 22 May 2015 14:25:04 +0300 Subject: [PATCH] Additiona fix to commit 92b6a389 (fix problem with the parsing arguments of the execfile): - command line may come with trailing '\n' so we have to process thsis properly --- src/PyInterp/PyInterp_Interp.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PyInterp/PyInterp_Interp.cxx b/src/PyInterp/PyInterp_Interp.cxx index b2d9b9459..7cbb3e304 100644 --- a/src/PyInterp/PyInterp_Interp.cxx +++ b/src/PyInterp/PyInterp_Interp.cxx @@ -380,7 +380,9 @@ static int compile_command(const char *command, PyObject * global_ctxt, PyObject std::string singleCommand = command; std::string commandArgs = ""; - std::size_t pos = std::string(command).find("args:"); + if (singleCommand.at(singleCommand.size()-1) == '\n') + singleCommand.erase(singleCommand.size()-1); + std::size_t pos = singleCommand.find("args:"); if (pos != std::string::npos) { commandArgs = singleCommand.substr(pos+5); commandArgs = commandArgs.substr(0, commandArgs.length()-2); -- 2.39.2