From: Gregor Schneider Date: Sat, 29 May 2010 18:01:20 +0000 (+0000) Subject: [CMD] File completion X-Git-Tag: backups/header-work@57446~11^2~196 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=fcb1ce77af507375b5ee415e4f1a095c82575fdd [CMD] File completion - Don't pass device paths to FindFirstFile (similar to r47418) - Allows to complete files, whose names start like DOS devices (COMx, LPTx. AUX, NUL, CON, etc) See issue #4848 for more details. svn path=/trunk/; revision=47421 --- diff --git a/reactos/base/shell/cmd/filecomp.c b/reactos/base/shell/cmd/filecomp.c index 7cb99a72f12..d2127fde250 100644 --- a/reactos/base/shell/cmd/filecomp.c +++ b/reactos/base/shell/cmd/filecomp.c @@ -590,10 +590,20 @@ VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor) /* Start the search for all the files */ GetFullPathName(szBaseWord, MAX_PATH, szSearchPath, NULL); + + /* Got a device path? Fallback to the the current dir plus the short path */ + if (szSearchPath[0] == _T('\\') && szSearchPath[1] == _T('\\') && + szSearchPath[2] == _T('.') && szSearchPath[3] == _T('\\')) + { + GetCurrentDirectory(MAX_PATH, szSearchPath); + _tcscat(szSearchPath, _T("\\")); + _tcscat(szSearchPath, szBaseWord); + } + if(StartLength > 0) - { + { _tcscat(szSearchPath,_T("*")); - } + } _tcscpy(LastSearch,szSearchPath); _tcscpy(LastPrefix,szPrefix); }