[CMD]: Fix the "TYPE" command so that it doesn't interpret the optional /P switch as a filename.

svn path=/trunk/; revision=72956
This commit is contained in:
Hermès Bélusca-Maïto
2016-10-10 19:17:03 +00:00
parent b408826a0b
commit 5bcbde18ec
+6 -2
View File
@@ -60,7 +60,7 @@ INT cmd_type(LPTSTR param)
for (i = 0; i < argc; i++)
{
if(*argv[i] == _T('/') && _tcslen(argv[i]) >= 2 && _totupper(argv[i][1]) == _T('P'))
if (argv[i][0] == _T('/') && _tcslen(argv[i]) == 2 && _totupper(argv[i][1]) == _T('P'))
{
bPaging = TRUE;
}
@@ -68,11 +68,15 @@ INT cmd_type(LPTSTR param)
for (i = 0; i < argc; i++)
{
if (_T('/') == argv[i][0] && _totupper(argv[i][1]) != _T('P'))
if (argv[i][0] == _T('/') && _totupper(argv[i][1]) != _T('P'))
{
ConErrResPrintf(STRING_TYPE_ERROR1, argv[i] + 1);
continue;
}
if (argv[i][0] == _T('/') && _tcslen(argv[i]) == 2 && _totupper(argv[i][1]) == _T('P'))
{
continue;
}
nErrorLevel = 0;