We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c135351 commit 2f89d89Copy full SHA for 2f89d89
1 file changed
src/common/os/win32/mod_loader.cpp
@@ -187,13 +187,13 @@ bool ModuleLoader::isLoadableModule(const PathName& module)
187
188
void ModuleLoader::doctorModuleExtension(PathName& name)
189
{
190
- if (name.length() > 4)
+ const char* dllExt = ".dll";
191
+ const size_t dllExtLen = strlen(dllExt);
192
+ if (name.length() <= dllExtLen ||
193
+ PathName(name, name.length() - dllExtLen, dllExtLen) != dllExt)
194
- PathName ext(name, name.length() - 4, 4);
- if (ext == ".dll")
- return;
195
+ name.appendString(".dll");
196
}
- name.appendString(".dll");
197
198
199
ModuleLoader::Module* ModuleLoader::loadModule(const PathName& modPath)
0 commit comments