Skip to content

Commit 2f89d89

Browse files
committed
misc
1 parent c135351 commit 2f89d89

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/common/os/win32/mod_loader.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,13 @@ bool ModuleLoader::isLoadableModule(const PathName& module)
187187

188188
void ModuleLoader::doctorModuleExtension(PathName& name)
189189
{
190-
if (name.length() > 4)
190+
const char* dllExt = ".dll";
191+
const size_t dllExtLen = strlen(dllExt);
192+
if (name.length() <= dllExtLen ||
193+
PathName(name, name.length() - dllExtLen, dllExtLen) != dllExt)
191194
{
192-
PathName ext(name, name.length() - 4, 4);
193-
if (ext == ".dll")
194-
return;
195+
name.appendString(".dll");
195196
}
196-
name.appendString(".dll");
197197
}
198198

199199
ModuleLoader::Module* ModuleLoader::loadModule(const PathName& modPath)

0 commit comments

Comments
 (0)