projects
/
reactos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make sure that FileList is not empty. fixes bug #884.
[reactos.git]
/
reactos
/
subsys
/
system
/
cmd
/
filecomp.c
diff --git
a/reactos/subsys/system/cmd/filecomp.c
b/reactos/subsys/system/cmd/filecomp.c
index
1e174d3
..
5540bc3
100644
(file)
--- a/
reactos/subsys/system/cmd/filecomp.c
+++ b/
reactos/subsys/system/cmd/filecomp.c
@@
-535,7
+535,7
@@
VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor)
while (_istspace (*line))
line++;
while (_istspace (*line))
line++;
- if(!_tcsn
cmp (line, _T("rd "), 3) || !_tcsn
cmp (line, _T("cd "), 3))
+ if(!_tcsn
icmp (line, _T("rd "), 3) || !_tcsni
cmp (line, _T("cd "), 3))
ShowAll = FALSE;
/* Copy the string, str can be edited and orginal should not be */
ShowAll = FALSE;
/* Copy the string, str can be edited and orginal should not be */
@@
-645,7
+645,17
@@
VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor)
}while(FindNextFile(hFile,&file));
}while(FindNextFile(hFile,&file));
-
+ /* Check the size of the list to see if we
+ found any matches */
+ if(FileListSize == 0)
+ {
+ _tcscpy(strOut,szOrginal);
+ CloseHandle(hFile);
+ if(FileList != NULL)
+ free(FileList);
+ return;
+
+ }
/* Sort the files */
qsort(FileList,FileListSize,sizeof(FileName), compare);
/* Sort the files */
qsort(FileList,FileListSize,sizeof(FileName), compare);