Handle possible error from FindFirstFile. Thanks to Thomas for finding the problem.
authorBrandon Turner <turnerb7@msu.edu>
Sun, 30 Oct 2005 18:01:50 +0000 (18:01 +0000)
committerBrandon Turner <turnerb7@msu.edu>
Sun, 30 Oct 2005 18:01:50 +0000 (18:01 +0000)
svn path=/trunk/; revision=18890

reactos/subsys/system/cmd/misc.c

index d581f62..5efd8e1 100644 (file)
@@ -101,6 +101,11 @@ VOID GetPathCase( TCHAR * Path, TCHAR * OutPath)
                else
                {
                        hFind = FindFirstFile(TempPath,&FindFileData);
+                       if(hFind == INVALID_HANDLE_VALUE)
+                       {
+                               _tcscpy(OutPath, Path);
+                               return;
+                       }
                        _tcscat(TempPath, _T("\\"));
                        _tcscat(OutPath, FindFileData.cFileName);
                        _tcscat(OutPath, _T("\\"));