Author: weiden
Date: Wed Aug 1 23:50:28 2007
New Revision: 28081
URL:
http://svn.reactos.org/svn/reactos?rev=28081&view=rev
Log:
Special handling for some fake dos devices
Modified:
trunk/reactos/base/shell/cmd/dir.c
Modified: trunk/reactos/base/shell/cmd/dir.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/dir.c?rev=2…
==============================================================================
--- trunk/reactos/base/shell/cmd/dir.c (original)
+++ trunk/reactos/base/shell/cmd/dir.c Wed Aug 1 23:50:28 2007
@@ -1320,6 +1320,20 @@
}
else if (pszFilePart != NULL)
*pszFilePart = _T('\0');
+ else
+ {
+ len = _tcslen(szTemp);
+ if (len > 0 && szTemp[len - 1] != _T('\\') &&
+ GetFileAttributes(szTemp) == INVALID_FILE_ATTRIBUTES &&
+ GetLastError() == ERROR_PATH_NOT_FOUND)
+ {
+ /* Special case for some fake dos devices, such as con:
+ GetFullPathName doesn't return a pszFilePart pointer
+ so we're going to fix this ourselves */
+ while (len > 0 && szTemp[len - 1] != _T('\\'))
+ szTemp[--len] = _T('\0');
+ }
+ }
len = _tcslen(szTemp);
if ((len != 3 || szTemp[len - 2] != _T(':')) && szTemp[len - 1] ==
_T('\\'))