From 57b48a273438159698a72d1e94a580b49337d234 Mon Sep 17 00:00:00 2001 From: mfe Date: Fri, 21 Feb 2014 13:46:11 +0100 Subject: [PATCH] Fix code source mode Even when filename and moduleName were empty, a findModule was done and throws an exception preventing moduleSource to be use instead. Signed-off-by: mfe --- lib/IlmCtl/CtlInterpreter.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/IlmCtl/CtlInterpreter.cpp b/lib/IlmCtl/CtlInterpreter.cpp index 93d251bd..f22058e7 100755 --- a/lib/IlmCtl/CtlInterpreter.cpp +++ b/lib/IlmCtl/CtlInterpreter.cpp @@ -249,7 +249,7 @@ Interpreter::findModule (const string& moduleName) } THROW (ArgExc, "Cannot find CTL module \"" << moduleName << "\"."); - return ""; + return ""; // return to prevent a warning with some compilers. } @@ -269,7 +269,7 @@ Interpreter::findModule (const string& moduleName) } THROW (ArgExc, "Cannot find CTL module \"" << moduleName << "\"."); - return ""; + return ""; // return to prevent a warning with some compilers. } void @@ -435,7 +435,12 @@ Interpreter::loadModuleRecursive (const string &moduleName, const string &fileNa return; } - string realFileName = fileName.empty() ? findModule (moduleName) : fileName; + string realFileName; + if(fileName.empty() && !moduleName.empty()) + realFileName = findModule (moduleName); + else + realFileName = fileName; + _loadModule(moduleName, realFileName, moduleSource); }