Skip to content

Commit 57b48a2

Browse files
mfeaforsythe
authored andcommitted
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 <[email protected]>
1 parent f525858 commit 57b48a2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/IlmCtl/CtlInterpreter.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ Interpreter::findModule (const string& moduleName)
249249
}
250250

251251
THROW (ArgExc, "Cannot find CTL module \"" << moduleName << "\".");
252-
return "";
252+
return ""; // return to prevent a warning with some compilers.
253253
}
254254

255255

@@ -269,7 +269,7 @@ Interpreter::findModule (const string& moduleName)
269269
}
270270

271271
THROW (ArgExc, "Cannot find CTL module \"" << moduleName << "\".");
272-
return "";
272+
return ""; // return to prevent a warning with some compilers.
273273
}
274274

275275
void
@@ -435,7 +435,12 @@ Interpreter::loadModuleRecursive (const string &moduleName, const string &fileNa
435435
return;
436436
}
437437

438-
string realFileName = fileName.empty() ? findModule (moduleName) : fileName;
438+
string realFileName;
439+
if(fileName.empty() && !moduleName.empty())
440+
realFileName = findModule (moduleName);
441+
else
442+
realFileName = fileName;
443+
439444

440445
_loadModule(moduleName, realFileName, moduleSource);
441446
}

0 commit comments

Comments
 (0)