Author: weiden
Date: Sat Jul 14 12:01:01 2007
New Revision: 27644
URL:
http://svn.reactos.org/svn/reactos?rev=27644&view=rev
Log:
Don't strip the trailing backslash if the path is only a drive
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 Sat Jul 14 12:01:01 2007
@@ -1523,12 +1523,15 @@
{
TCHAR szMsg[RC_STRING_MAX_SIZE];
TCHAR szTemp[MAX_PATH]; /* A buffer to format the directory header */
+ SIZE_T len;
/* Print directory header */
_tcscpy(szTemp, szCurPath);
- /* We cut the trailing \ of the full path */
- szTemp[_tcslen(szTemp)-1] = _T('\0');
+ /* We cut the trailing \ of the full path, unless the path is a drive */
+ len = _tcslen(szTemp);
+ if ((len != 3 || szTemp[len - 2] != _T(':')) && szTemp[len - 1] ==
_T('\\'))
+ szTemp[len-1] = _T('\0');
/* Condition to print header:
We are not printing in bare format