Skip to content

Commit

Permalink
Fix code source mode
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mfe authored and aforsythe committed Jun 3, 2014
1 parent f525858 commit 57b48a2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/IlmCtl/CtlInterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}


Expand All @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 57b48a2

Please sign in to comment.