Author: gschneider Date: Sat May 29 20:01:20 2010 New Revision: 47421
URL: http://svn.reactos.org/svn/reactos?rev=47421&view=rev Log: [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.
Modified: trunk/reactos/base/shell/cmd/filecomp.c
Modified: trunk/reactos/base/shell/cmd/filecomp.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/filecomp.c?r... ============================================================================== --- trunk/reactos/base/shell/cmd/filecomp.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/filecomp.c [iso-8859-1] Sat May 29 20:01:20 2010 @@ -590,10 +590,20 @@
/* 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); }