diff --git a/reactos/subsys/system/cmd/misc.c b/reactos/subsys/system/cmd/misc.c index d581f621470..5efd8e19b68 100644 --- a/reactos/subsys/system/cmd/misc.c +++ b/reactos/subsys/system/cmd/misc.c @@ -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("\\"));