From 15fb98b4ad9ef2c667ccbd2afdc662a8cac16385 Mon Sep 17 00:00:00 2001 From: Brandon Turner Date: Sun, 30 Oct 2005 18:01:50 +0000 Subject: [PATCH] Handle possible error from FindFirstFile. Thanks to Thomas for finding the problem. svn path=/trunk/; revision=18890 --- reactos/subsys/system/cmd/misc.c | 5 +++++ 1 file changed, 5 insertions(+) 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("\\"));