return TRUE;
}
-static LPTSTR
+static LPCTSTR
GetFileExt(IN LPTSTR FileName)
{
- if (FileName == 0)
- return _T("");
-
- int i = _tcsclen(FileName);
- while ((i >= 0) && (FileName[i] != _T('.')))
- i--;
-
- FileName = _tcslwr(FileName);
+ LPCTSTR Dot;
- if (i >= 0)
- return &FileName[i];
- else
+ Dot = _tcsrchr(FileName, _T('.'));
+ if (!Dot)
return _T("");
+
+ return Dot;
}
static BOOL
{
LPCTSTR pszExtension = GetFileExt(FileName);
- if ((_tcscmp(pszExtension, _T(".inf")) == 0) && (_tcscmp(LastDirPath, DirPath) != 0))
+ if ((_tcsicmp(pszExtension, _T(".inf")) == 0) && (_tcscmp(LastDirPath, DirPath) != 0))
{
_tcscpy(LastDirPath, DirPath);