From 57c8590b213994a51263f9c0ad9a856d6d77f2fb Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Wed, 22 Nov 2017 18:43:48 -0500 Subject: [PATCH] When resolving module names, only use defines if no other choice. --- src/V3PreShell.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/V3PreShell.cpp b/src/V3PreShell.cpp index 8e628cf2f..9dda82071 100644 --- a/src/V3PreShell.cpp +++ b/src/V3PreShell.cpp @@ -123,12 +123,15 @@ protected: bool preprocOpen (FileLine* fl, V3InFilter* filterp, const string& modname, const string& lastpath, const string& errmsg) { // Error message or "" to suppress // Returns true if successful - // Allow user to put `defined names on the command line instead of filenames, - // then convert them properly. - string ppmodname = s_preprocp->removeDefines (modname); + // Try a pure name in case user has a bogus `filename they don't expect + string filename = v3Global.opt.filePath (fl, modname, lastpath, errmsg); + if (filename=="") { + // Allow user to put `defined names on the command line instead of filenames, + // then convert them properly. + string ppmodname = s_preprocp->removeDefines (modname); - // Open include or master file - string filename = v3Global.opt.filePath (fl, ppmodname, lastpath, errmsg); + filename = v3Global.opt.filePath (fl, ppmodname, lastpath, errmsg); + } if (filename=="") return false; // Not found UINFO(2," Reading "<