[ros-diffs] [weiden] 28077: Fix displaying the free space on the volume

weiden at svn.reactos.org weiden at svn.reactos.org
Wed Aug 1 20:36:23 CEST 2007


Author: weiden
Date: Wed Aug  1 22:36:23 2007
New Revision: 28077

URL: http://svn.reactos.org/svn/reactos?rev=28077&view=rev
Log:
Fix displaying the free space on the volume

Modified:
    trunk/reactos/base/shell/cmd/dir.c
    trunk/reactos/base/shell/cmd/lang/en-US.rc

Modified: trunk/reactos/base/shell/cmd/dir.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/dir.c?rev=28077&r1=28076&r2=28077&view=diff
==============================================================================
--- trunk/reactos/base/shell/cmd/dir.c (original)
+++ trunk/reactos/base/shell/cmd/dir.c Wed Aug  1 22:36:23 2007
@@ -898,7 +898,6 @@
    }
    else
    {
-
       /* Print File Summary */
       /* Condition to print summary is:
       If we are not in bare format and if we have results! */
@@ -908,7 +907,6 @@
          ConOutPrintfPaging(FALSE,szMsg,ulFiles, szBuffer);
       else
          ConOutPrintf(szMsg,ulFiles, szBuffer);
-
    }
 
 	/* Print total directories and freespace */
@@ -1785,9 +1783,10 @@
 CommandDir(LPTSTR first, LPTSTR rest)
 {
 	TCHAR	dircmd[256];	/* A variable to store the DIRCMD enviroment variable */
-	TCHAR	volume[MAX_PATH];
+	TCHAR	path[MAX_PATH];
 	TCHAR	prev_volume[MAX_PATH];
 	LPTSTR*	params = NULL;
+	LPTSTR	pszFilePart;
 	INT		entries = 0;
 	UINT	loop = 0;
 	DIRSWITCHFLAGS stFlags;
@@ -1881,13 +1880,20 @@
 		ChangedVolume = TRUE;
 
 		if (!stFlags.bBareFormat &&
-		    GetVolumePathName(params[loop], volume, sizeof(volume) / sizeof(TCHAR)))
-		{
-			if (!_tcscmp(volume, prev_volume))
+		    GetVolumePathName(params[loop], path, sizeof(path) / sizeof(TCHAR)))
+		{
+			if (!_tcscmp(path, prev_volume))
 				ChangedVolume = FALSE;
 			else
-				_tcscpy(prev_volume, volume);
-		}
+				_tcscpy(prev_volume, path);
+		}
+		else if (GetFullPathName(params[loop], sizeof(path) / sizeof(TCHAR), path, &pszFilePart) != 0)
+		{
+			if (pszFilePart != NULL)
+				*pszFilePart = _T('\0');
+		}
+		else
+			_tcscpy(path, params[loop]);
 
 		if (ChangedVolume && !stFlags.bBareFormat) {
 			if (!PrintDirectoryHeader (params[loop], &stFlags)) {
@@ -1904,7 +1910,7 @@
 		}
 
 		/* print the footer */
-		PrintSummary(params[loop],
+		PrintSummary(path,
 			recurse_file_cnt,
 			recurse_dir_cnt,
 			recurse_bytes,

Modified: trunk/reactos/base/shell/cmd/lang/en-US.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/en-US.rc?rev=28077&r1=28076&r2=28077&view=diff
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/en-US.rc (original)
+++ trunk/reactos/base/shell/cmd/lang/en-US.rc Wed Aug  1 22:36:23 2007
@@ -206,7 +206,7 @@
 STRING_DIR_HELP3, " Volume in drive %c has no label.\n"
 STRING_DIR_HELP4, " Volume Serial Number is %04X-%04X\n"
 STRING_DIR_HELP5, "\n     Total Files Listed:\n%16i File(s)% 14s bytes\n"
-STRING_DIR_HELP6, "%16i Dir(s)% 15s bytes\n"
+STRING_DIR_HELP6, "%16i Dir(s)% 15s bytes free\n"
 STRING_DIR_HELP7, "\n Directory of %s\n\n"
 STRING_DIR_HELP8, "%16i File(s)% 14s bytes\n"
 




More information about the Ros-diffs mailing list