index 5d3d3ca..dbf2ad2 100644 --- a/base/shell/cmd/del.c +++ b/base/shell/cmd/del.c @@ -361,6 +361,11 @@ INT CommandDelete (LPTSTR param) LONG ch; TCHAR szOriginalArg[MAX_PATH]; + /* when param is directory */ + TCHAR szFullPath[MAX_PATH]; + LPTSTR pFilePart; + + /*checks the first two chars of param to see if it is /? this however allows the following command to not show help "del frog.txt /?" */ @@ -517,6 +522,19 @@ INT CommandDelete (LPTSTR param) { _tcscpy(szOriginalArg,arg[i]); } + + /* if filename is a folder, assume * in that folder */ + GetFullPathName(szOriginalArg, + MAX_PATH, + szFullPath, + &pFilePart); + + if (IsExistingDirectory(szFullPath)) + { + _tcscat(szFullPath, _T("\\*")); + _tcscpy(szOriginalArg, szFullPath); + } + dwFiles += ProcessDirectory(szOriginalArg, &dwFlags, dwAttrFlags); }