Author: hbelusca
Date: Mon Oct 10 19:17:03 2016
New Revision: 72956
URL:
http://svn.reactos.org/svn/reactos?rev=72956&view=rev
Log:
[CMD]: Fix the "TYPE" command so that it doesn't interpret the optional /P
switch as a filename.
Modified:
trunk/reactos/base/shell/cmd/type.c
Modified: trunk/reactos/base/shell/cmd/type.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/type.c?rev=…
==============================================================================
--- trunk/reactos/base/shell/cmd/type.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/type.c [iso-8859-1] Mon Oct 10 19:17:03 2016
@@ -60,7 +60,7 @@
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,9 +68,13 @@
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;
}