mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-02-26 19:54:14 +01:00
Fixed amb1534 - VDF files with a ".vdf" that wasn't at the very end of the filename were being opened by MM:S. This was due to the use of strstr.
--HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40687
This commit is contained in:
parent
3ccc15a2ce
commit
6340b6f86b
@ -1412,6 +1412,7 @@ void LookForVDFs(const char *dir)
|
|||||||
HANDLE hFind;
|
HANDLE hFind;
|
||||||
WIN32_FIND_DATA fd;
|
WIN32_FIND_DATA fd;
|
||||||
char error[255];
|
char error[255];
|
||||||
|
int extidx;
|
||||||
|
|
||||||
g_Metamod.PathFormat(path, sizeof(path), "%s\\*.*", dir);
|
g_Metamod.PathFormat(path, sizeof(path), "%s\\*.*", dir);
|
||||||
if ((hFind = FindFirstFile(path, &fd)) == INVALID_HANDLE_VALUE)
|
if ((hFind = FindFirstFile(path, &fd)) == INVALID_HANDLE_VALUE)
|
||||||
@ -1435,7 +1436,8 @@ void LookForVDFs(const char *dir)
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (strstr(fd.cFileName, ".vdf") == NULL)
|
extidx = strlen(fd.cFileName) - 4;
|
||||||
|
if (extidx < 0 || stricmp(&fd.cFileName[extidx], ".vdf"))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1461,7 +1463,8 @@ void LookForVDFs(const char *dir)
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (strstr(pEnt->d_name, ".vdf") == NULL)
|
extidx = strlen(fd.cFileName) - 4;
|
||||||
|
if (extidx < 0 || stricmp(&fd.cFileName[extidx], ".vdf"))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user