diff --git a/sourcemm/metamod.cpp b/sourcemm/metamod.cpp index a3efe30..77fd7b2 100644 --- a/sourcemm/metamod.cpp +++ b/sourcemm/metamod.cpp @@ -1412,6 +1412,7 @@ void LookForVDFs(const char *dir) HANDLE hFind; WIN32_FIND_DATA fd; char error[255]; + int extidx; g_Metamod.PathFormat(path, sizeof(path), "%s\\*.*", dir); if ((hFind = FindFirstFile(path, &fd)) == INVALID_HANDLE_VALUE) @@ -1435,7 +1436,8 @@ void LookForVDFs(const char *dir) { continue; } - if (strstr(fd.cFileName, ".vdf") == NULL) + extidx = strlen(fd.cFileName) - 4; + if (extidx < 0 || stricmp(&fd.cFileName[extidx], ".vdf")) { continue; } @@ -1461,7 +1463,8 @@ void LookForVDFs(const char *dir) { continue; } - if (strstr(pEnt->d_name, ".vdf") == NULL) + extidx = strlen(fd.cFileName) - 4; + if (extidx < 0 || stricmp(&fd.cFileName[extidx], ".vdf")) { continue; }