mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 01:42:30 +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
|
@ -213,7 +213,7 @@ INT CommandAttrib (LPTSTR param)
|
|||
nErrorLevel = 0;
|
||||
|
||||
/* build parameter array */
|
||||
arg = split (param, &argc, FALSE);
|
||||
arg = split (param, &argc, FALSE, FALSE);
|
||||
|
||||
/* check for options */
|
||||
for (i = 0; i < argc; i++)
|
||||
|
|
|
@ -33,7 +33,7 @@ INT CommandChcp (LPTSTR param)
|
|||
nErrorLevel = 0;
|
||||
|
||||
/* get parameters */
|
||||
arg = split (param, &args, FALSE);
|
||||
arg = split (param, &args, FALSE, FALSE);
|
||||
|
||||
if (args == 0)
|
||||
{
|
||||
|
|
|
@ -150,7 +150,7 @@ CommandChoice (LPTSTR param)
|
|||
}
|
||||
|
||||
/* build parameter array */
|
||||
arg = split (param, &argc, FALSE);
|
||||
arg = split (param, &argc, FALSE, FALSE);
|
||||
|
||||
/* evaluate arguments */
|
||||
if (argc > 0)
|
||||
|
|
|
@ -332,7 +332,7 @@ BOOL SetRootPath(TCHAR *oldpath,TCHAR *InPath);
|
|||
TCHAR cgetchar (VOID);
|
||||
BOOL CheckCtrlBreak (INT);
|
||||
BOOL add_entry (LPINT ac, LPTSTR **arg, LPCTSTR entry);
|
||||
LPTSTR *split (LPTSTR, LPINT, BOOL);
|
||||
LPTSTR *split (LPTSTR, LPINT, BOOL, BOOL);
|
||||
LPTSTR *splitspace (LPTSTR, LPINT);
|
||||
VOID freep (LPTSTR *);
|
||||
LPTSTR _stpcpy (LPTSTR, LPCTSTR);
|
||||
|
|
|
@ -438,7 +438,7 @@ INT cmd_copy(LPTSTR param)
|
|||
|
||||
|
||||
/* Split the user input into array */
|
||||
arg = split(param, &argc, FALSE);
|
||||
arg = split(param, &argc, FALSE, TRUE);
|
||||
nFiles = argc;
|
||||
|
||||
/* Read switches and count files */
|
||||
|
|
|
@ -193,7 +193,7 @@ INT cmd_date (LPTSTR param)
|
|||
nErrorLevel = 0;
|
||||
|
||||
/* build parameter array */
|
||||
arg = split (param, &argc, FALSE);
|
||||
arg = split (param, &argc, FALSE, FALSE);
|
||||
|
||||
/* check for options */
|
||||
for (i = 0; i < argc; i++)
|
||||
|
|
|
@ -385,7 +385,7 @@ INT CommandDelete (LPTSTR param)
|
|||
|
||||
nErrorLevel = 0;
|
||||
|
||||
arg = split (param, &args, FALSE);
|
||||
arg = split (param, &args, FALSE, FALSE);
|
||||
|
||||
if (args == 0)
|
||||
{
|
||||
|
|
|
@ -106,7 +106,7 @@ INT CommandFree (LPTSTR param)
|
|||
else
|
||||
szParam = param;
|
||||
|
||||
arg = split (szParam, &argc, FALSE);
|
||||
arg = split (szParam, &argc, FALSE, FALSE);
|
||||
|
||||
for (i = 0; i < argc; i++)
|
||||
PrintDiskInfo (arg[i]);
|
||||
|
|
|
@ -321,7 +321,7 @@ INT cmd_mkdir (LPTSTR param)
|
|||
return 0;
|
||||
}
|
||||
|
||||
p = split (param, &argc, FALSE);
|
||||
p = split (param, &argc, FALSE, FALSE);
|
||||
if (argc == 0)
|
||||
{
|
||||
ConErrResPuts(STRING_ERROR_REQ_PARAM_MISSING);
|
||||
|
@ -411,7 +411,7 @@ INT cmd_rmdir (LPTSTR param)
|
|||
return 0;
|
||||
}
|
||||
|
||||
arg = split (param, &args, FALSE);
|
||||
arg = split (param, &args, FALSE, FALSE);
|
||||
dirCount = 0;
|
||||
|
||||
/* check for options anywhere in command line */
|
||||
|
|
|
@ -275,7 +275,7 @@ static BOOL expand (LPINT ac, LPTSTR **arg, LPCTSTR pattern)
|
|||
* 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 start;
|
||||
|
@ -315,7 +315,7 @@ LPTSTR *split (LPTSTR s, LPINT args, BOOL expand_wildcards)
|
|||
/* check for separators */
|
||||
if (_istspace(*s) ||
|
||||
(*s == _T('/')) ||
|
||||
(*s == _T('+')))
|
||||
(handle_plus && (*s == _T('+'))))
|
||||
{
|
||||
/* Make length at least one character */
|
||||
if (s == start) s++;
|
||||
|
|
|
@ -132,7 +132,7 @@ cmd_mklink(LPTSTR param)
|
|||
return 0;
|
||||
}
|
||||
|
||||
arg = split(param, &argc, FALSE);
|
||||
arg = split(param, &argc, FALSE, FALSE);
|
||||
for (i = 0; i < argc; i++)
|
||||
{
|
||||
if (arg[i][0] == _T('/'))
|
||||
|
|
|
@ -97,7 +97,7 @@ INT cmd_rename (LPTSTR param)
|
|||
nErrorLevel = 0;
|
||||
|
||||
/* 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)
|
||||
{
|
||||
|
|
|
@ -376,7 +376,7 @@ INT cmd_replace (LPTSTR param)
|
|||
}
|
||||
|
||||
/* Divide the argument in to an array of c-strings */
|
||||
arg = split (param, &argc, FALSE);
|
||||
arg = split (param, &argc, FALSE, FALSE);
|
||||
nFiles = argc;
|
||||
|
||||
/* Read options */
|
||||
|
|
|
@ -145,7 +145,7 @@ INT cmd_time (LPTSTR param)
|
|||
nErrorLevel = 0;
|
||||
|
||||
/* build parameter array */
|
||||
arg = split (param, &argc, FALSE);
|
||||
arg = split (param, &argc, FALSE, FALSE);
|
||||
|
||||
/* check for options */
|
||||
for (i = 0; i < argc; i++)
|
||||
|
|
|
@ -100,7 +100,7 @@ INT CommandTimer (LPTSTR param)
|
|||
|
||||
nErrorLevel = 0;
|
||||
|
||||
p = split (param, &argc, FALSE);
|
||||
p = split (param, &argc, FALSE, FALSE);
|
||||
|
||||
//read options
|
||||
for (i = 0; i < argc; i++)
|
||||
|
|
|
@ -56,7 +56,7 @@ INT cmd_type (LPTSTR param)
|
|||
return 1;
|
||||
}
|
||||
|
||||
argv = split (param, &argc, TRUE);
|
||||
argv = split (param, &argc, TRUE, FALSE);
|
||||
|
||||
for(i = 0; i < argc; i++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue