core-legacy/sourcemm.cpp
changeset 577 80120bac7719
parent 548 dd85920ecaaf
child 580 783e91c5f445
     1.1 --- a/core-legacy/sourcemm.cpp	Tue Nov 18 07:20:38 2008 -0600
     1.2 +++ b/core-legacy/sourcemm.cpp	Wed Nov 19 01:14:16 2008 -0600
     1.3 @@ -704,17 +704,19 @@
     1.4  void LookForVDFs(const char *dir)
     1.5  {
     1.6  	char path[MAX_PATH];
     1.7 -	int extidx;
     1.8  
     1.9  #if defined _MSC_VER
    1.10  	HANDLE hFind;
    1.11  	WIN32_FIND_DATA fd;
    1.12  	char error[255];
    1.13  
    1.14 -	g_SmmAPI.PathFormat(path, sizeof(path), "%s\\*.*", dir);
    1.15 +	g_SmmAPI.PathFormat(path, sizeof(path), "%s\\*.vdf", dir);
    1.16  	if ((hFind = FindFirstFile(path, &fd)) == INVALID_HANDLE_VALUE)
    1.17  	{
    1.18  		DWORD dw = GetLastError();
    1.19 +		if (dw == ERROR_FILE_NOT_FOUND)
    1.20 +			return;
    1.21 +
    1.22  		FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
    1.23  			NULL,
    1.24  			dw,
    1.25 @@ -728,16 +730,6 @@
    1.26  
    1.27  	do
    1.28  	{
    1.29 -		if (strcmp(fd.cFileName, ".") == 0
    1.30 -			|| strcmp(fd.cFileName, "..") == 0)
    1.31 -		{
    1.32 -			continue;
    1.33 -		}
    1.34 -		extidx = strlen(fd.cFileName) - 4;
    1.35 -		if (extidx < 0 || stricmp(&fd.cFileName[extidx], ".vdf"))
    1.36 -		{
    1.37 -			continue;
    1.38 -		}
    1.39  		g_SmmAPI.PathFormat(path, sizeof(path), "%s\\%s", dir, fd.cFileName);
    1.40  		LoadFromVDF(path);
    1.41  	} while (FindNextFile(hFind, &fd));
    1.42 @@ -746,6 +738,7 @@
    1.43  #else
    1.44  	DIR *pDir;
    1.45  	struct dirent *pEnt;
    1.46 +	int extidx;
    1.47  
    1.48  	if ((pDir = opendir(dir)) == NULL)
    1.49  	{