}
else
{
-
/* Print File Summary */
/* Condition to print summary is:
If we are not in bare format and if we have results! */
ConOutPrintfPaging(FALSE,szMsg,ulFiles, szBuffer);
else
ConOutPrintf(szMsg,ulFiles, szBuffer);
-
}
/* Print total directories and freespace */
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;
ChangedVolume = TRUE;
if (!stFlags.bBareFormat &&
- GetVolumePathName(params[loop], volume, sizeof(volume) / sizeof(TCHAR)))
+ GetVolumePathName(params[loop], path, sizeof(path) / sizeof(TCHAR)))
{
- if (!_tcscmp(volume, prev_volume))
+ 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)) {
}
/* print the footer */
- PrintSummary(params[loop],
+ PrintSummary(path,
recurse_file_cnt,
recurse_dir_cnt,
recurse_bytes,
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"