From 9fe63ccc3cc75b7088b1af994d9cbda0beb116aa Mon Sep 17 00:00:00 2001 From: Petrus on Dupond Date: Tue, 26 Aug 2014 11:17:28 +0200 Subject: [PATCH] Do not strip the '>LIFO' from the original command, but strip a copy! In case the command is within a procedure, the redirection will not be executed at the second time. --- rexxlib/Interpreter.cpp | 8 ++++---- rexxlib/Interpreter.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rexxlib/Interpreter.cpp b/rexxlib/Interpreter.cpp index a6a5a3e..570a46a 100644 --- a/rexxlib/Interpreter.cpp +++ b/rexxlib/Interpreter.cpp @@ -1288,15 +1288,15 @@ void Interpreter::setProperty(Property prop, RexxString & value) /*------------------------------------------------Interpreter::processCommand-+ | | +----------------------------------------------------------------------------*/ -void Interpreter::processCommand(RexxString & cmd, RexxString & env) +void Interpreter::processCommand(RexxString const & cmd, RexxString & env) { DataQueueMgr::QueueMode qmodeIn; DataQueueMgr::QueueMode qmodeOut; int rc; if (!env.length() || (env == STR_ANY_SHELL) || (env == STR_DEFAULT_SHELL)) { - cmd = DataQueueMgr::stripQueueModes(cmd, qmodeIn, qmodeOut); - rc = execCommand(cmd, qmodeIn, qmodeOut, RexxString::Nil); + RexxString stripped(DataQueueMgr::stripQueueModes(cmd, qmodeIn, qmodeOut)); + rc = execCommand(stripped, qmodeIn, qmodeOut, RexxString::Nil); }else { rc = -3; } @@ -1396,7 +1396,7 @@ void Interpreter::processTraceClause(RexxString ** ppStrCreated, int iMaxCreated | | +----------------------------------------------------------------------------*/ int Interpreter::execCommand( - RexxString & cmd, + RexxString const & cmd, DataQueueMgr::QueueMode qmodeIn, DataQueueMgr::QueueMode qmodeOut, RexxString & res diff --git a/rexxlib/Interpreter.h b/rexxlib/Interpreter.h index 25c876b..3e27640 100644 --- a/rexxlib/Interpreter.h +++ b/rexxlib/Interpreter.h @@ -104,12 +104,12 @@ class Interpreter : private Constants void setProperty(Property prop, RexxString & value); void loadFile(Arguments & args); void processTemplate(RexxString source); - void processCommand(RexxString & cmd, RexxString & env); + void processCommand(RexxString const & cmd, RexxString & env); char processInteractiveTrace(); void processTraceClause(RexxString ** ppStrCreated, int iMax); void expandRoutineArray(); int execCommand( - RexxString & cmd, + RexxString const & cmd, DataQueueMgr::QueueMode qmodeIn, DataQueueMgr::QueueMode qmodeOut, RexxString & res