mirror of
https://github.com/reactos/reactos.git
synced 2025-06-26 12:29:44 +00:00
[CMD]
Handle the + character only optionally as a token seperator, so that other commands like rename are not affected. svn path=/trunk/; revision=56349
This commit is contained in:
parent
a77220cc37
commit
ece4aa3f3f
16 changed files with 87 additions and 87 deletions
|
@ -213,7 +213,7 @@ INT CommandAttrib (LPTSTR param)
|
||||||
nErrorLevel = 0;
|
nErrorLevel = 0;
|
||||||
|
|
||||||
/* build parameter array */
|
/* build parameter array */
|
||||||
arg = split (param, &argc, FALSE);
|
arg = split (param, &argc, FALSE, FALSE);
|
||||||
|
|
||||||
/* check for options */
|
/* check for options */
|
||||||
for (i = 0; i < argc; i++)
|
for (i = 0; i < argc; i++)
|
||||||
|
|
|
@ -33,7 +33,7 @@ INT CommandChcp (LPTSTR param)
|
||||||
nErrorLevel = 0;
|
nErrorLevel = 0;
|
||||||
|
|
||||||
/* get parameters */
|
/* get parameters */
|
||||||
arg = split (param, &args, FALSE);
|
arg = split (param, &args, FALSE, FALSE);
|
||||||
|
|
||||||
if (args == 0)
|
if (args == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -150,7 +150,7 @@ CommandChoice (LPTSTR param)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* build parameter array */
|
/* build parameter array */
|
||||||
arg = split (param, &argc, FALSE);
|
arg = split (param, &argc, FALSE, FALSE);
|
||||||
|
|
||||||
/* evaluate arguments */
|
/* evaluate arguments */
|
||||||
if (argc > 0)
|
if (argc > 0)
|
||||||
|
|
|
@ -332,7 +332,7 @@ BOOL SetRootPath(TCHAR *oldpath,TCHAR *InPath);
|
||||||
TCHAR cgetchar (VOID);
|
TCHAR cgetchar (VOID);
|
||||||
BOOL CheckCtrlBreak (INT);
|
BOOL CheckCtrlBreak (INT);
|
||||||
BOOL add_entry (LPINT ac, LPTSTR **arg, LPCTSTR entry);
|
BOOL add_entry (LPINT ac, LPTSTR **arg, LPCTSTR entry);
|
||||||
LPTSTR *split (LPTSTR, LPINT, BOOL);
|
LPTSTR *split (LPTSTR, LPINT, BOOL, BOOL);
|
||||||
LPTSTR *splitspace (LPTSTR, LPINT);
|
LPTSTR *splitspace (LPTSTR, LPINT);
|
||||||
VOID freep (LPTSTR *);
|
VOID freep (LPTSTR *);
|
||||||
LPTSTR _stpcpy (LPTSTR, LPCTSTR);
|
LPTSTR _stpcpy (LPTSTR, LPCTSTR);
|
||||||
|
|
|
@ -438,7 +438,7 @@ INT cmd_copy(LPTSTR param)
|
||||||
|
|
||||||
|
|
||||||
/* Split the user input into array */
|
/* Split the user input into array */
|
||||||
arg = split(param, &argc, FALSE);
|
arg = split(param, &argc, FALSE, TRUE);
|
||||||
nFiles = argc;
|
nFiles = argc;
|
||||||
|
|
||||||
/* Read switches and count files */
|
/* Read switches and count files */
|
||||||
|
|
|
@ -193,7 +193,7 @@ INT cmd_date (LPTSTR param)
|
||||||
nErrorLevel = 0;
|
nErrorLevel = 0;
|
||||||
|
|
||||||
/* build parameter array */
|
/* build parameter array */
|
||||||
arg = split (param, &argc, FALSE);
|
arg = split (param, &argc, FALSE, FALSE);
|
||||||
|
|
||||||
/* check for options */
|
/* check for options */
|
||||||
for (i = 0; i < argc; i++)
|
for (i = 0; i < argc; i++)
|
||||||
|
|
|
@ -385,7 +385,7 @@ INT CommandDelete (LPTSTR param)
|
||||||
|
|
||||||
nErrorLevel = 0;
|
nErrorLevel = 0;
|
||||||
|
|
||||||
arg = split (param, &args, FALSE);
|
arg = split (param, &args, FALSE, FALSE);
|
||||||
|
|
||||||
if (args == 0)
|
if (args == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -106,7 +106,7 @@ INT CommandFree (LPTSTR param)
|
||||||
else
|
else
|
||||||
szParam = param;
|
szParam = param;
|
||||||
|
|
||||||
arg = split (szParam, &argc, FALSE);
|
arg = split (szParam, &argc, FALSE, FALSE);
|
||||||
|
|
||||||
for (i = 0; i < argc; i++)
|
for (i = 0; i < argc; i++)
|
||||||
PrintDiskInfo (arg[i]);
|
PrintDiskInfo (arg[i]);
|
||||||
|
|
|
@ -321,7 +321,7 @@ INT cmd_mkdir (LPTSTR param)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
p = split (param, &argc, FALSE);
|
p = split (param, &argc, FALSE, FALSE);
|
||||||
if (argc == 0)
|
if (argc == 0)
|
||||||
{
|
{
|
||||||
ConErrResPuts(STRING_ERROR_REQ_PARAM_MISSING);
|
ConErrResPuts(STRING_ERROR_REQ_PARAM_MISSING);
|
||||||
|
@ -411,7 +411,7 @@ INT cmd_rmdir (LPTSTR param)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
arg = split (param, &args, FALSE);
|
arg = split (param, &args, FALSE, FALSE);
|
||||||
dirCount = 0;
|
dirCount = 0;
|
||||||
|
|
||||||
/* check for options anywhere in command line */
|
/* check for options anywhere in command line */
|
||||||
|
|
|
@ -275,7 +275,7 @@ static BOOL expand (LPINT ac, LPTSTR **arg, LPCTSTR pattern)
|
||||||
* are spaces and slashes ('/').
|
* are spaces and slashes ('/').
|
||||||
*/
|
*/
|
||||||
|
|
||||||
LPTSTR *split (LPTSTR s, LPINT args, BOOL expand_wildcards)
|
LPTSTR *split (LPTSTR s, LPINT args, BOOL expand_wildcards, BOOL handle_plus)
|
||||||
{
|
{
|
||||||
LPTSTR *arg;
|
LPTSTR *arg;
|
||||||
LPTSTR start;
|
LPTSTR start;
|
||||||
|
@ -315,7 +315,7 @@ LPTSTR *split (LPTSTR s, LPINT args, BOOL expand_wildcards)
|
||||||
/* check for separators */
|
/* check for separators */
|
||||||
if (_istspace(*s) ||
|
if (_istspace(*s) ||
|
||||||
(*s == _T('/')) ||
|
(*s == _T('/')) ||
|
||||||
(*s == _T('+')))
|
(handle_plus && (*s == _T('+'))))
|
||||||
{
|
{
|
||||||
/* Make length at least one character */
|
/* Make length at least one character */
|
||||||
if (s == start) s++;
|
if (s == start) s++;
|
||||||
|
|
|
@ -132,7 +132,7 @@ cmd_mklink(LPTSTR param)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
arg = split(param, &argc, FALSE);
|
arg = split(param, &argc, FALSE, FALSE);
|
||||||
for (i = 0; i < argc; i++)
|
for (i = 0; i < argc; i++)
|
||||||
{
|
{
|
||||||
if (arg[i][0] == _T('/'))
|
if (arg[i][0] == _T('/'))
|
||||||
|
|
|
@ -97,7 +97,7 @@ INT cmd_rename (LPTSTR param)
|
||||||
nErrorLevel = 0;
|
nErrorLevel = 0;
|
||||||
|
|
||||||
/* Split the argument list.Args will be saved in arg vector*/
|
/* Split the argument list.Args will be saved in arg vector*/
|
||||||
arg = split(param, &args, FALSE);
|
arg = split(param, &args, FALSE, FALSE);
|
||||||
|
|
||||||
if (args < 2)
|
if (args < 2)
|
||||||
{
|
{
|
||||||
|
|
|
@ -376,7 +376,7 @@ INT cmd_replace (LPTSTR param)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Divide the argument in to an array of c-strings */
|
/* Divide the argument in to an array of c-strings */
|
||||||
arg = split (param, &argc, FALSE);
|
arg = split (param, &argc, FALSE, FALSE);
|
||||||
nFiles = argc;
|
nFiles = argc;
|
||||||
|
|
||||||
/* Read options */
|
/* Read options */
|
||||||
|
|
|
@ -145,7 +145,7 @@ INT cmd_time (LPTSTR param)
|
||||||
nErrorLevel = 0;
|
nErrorLevel = 0;
|
||||||
|
|
||||||
/* build parameter array */
|
/* build parameter array */
|
||||||
arg = split (param, &argc, FALSE);
|
arg = split (param, &argc, FALSE, FALSE);
|
||||||
|
|
||||||
/* check for options */
|
/* check for options */
|
||||||
for (i = 0; i < argc; i++)
|
for (i = 0; i < argc; i++)
|
||||||
|
|
|
@ -100,7 +100,7 @@ INT CommandTimer (LPTSTR param)
|
||||||
|
|
||||||
nErrorLevel = 0;
|
nErrorLevel = 0;
|
||||||
|
|
||||||
p = split (param, &argc, FALSE);
|
p = split (param, &argc, FALSE, FALSE);
|
||||||
|
|
||||||
//read options
|
//read options
|
||||||
for (i = 0; i < argc; i++)
|
for (i = 0; i < argc; i++)
|
||||||
|
|
|
@ -56,7 +56,7 @@ INT cmd_type (LPTSTR param)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
argv = split (param, &argc, TRUE);
|
argv = split (param, &argc, TRUE, FALSE);
|
||||||
|
|
||||||
for(i = 0; i < argc; i++)
|
for(i = 0; i < argc; i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue