mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 02:36:13 +00:00
Make CALL command do another round of %-variable substitutions.
svn path=/trunk/; revision=39879
This commit is contained in:
parent
ee68df6943
commit
39d2af2432
2 changed files with 12 additions and 5 deletions
|
@ -33,15 +33,12 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Perform CALL command.
|
* Perform CALL command.
|
||||||
*
|
|
||||||
* Allocate a new batch context and add it to the current chain.
|
|
||||||
* Call parsecommandline passing in our param string
|
|
||||||
* If No batch file was opened then remove our newly allocted
|
|
||||||
* context block.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
INT cmd_call (LPTSTR param)
|
INT cmd_call (LPTSTR param)
|
||||||
{
|
{
|
||||||
|
TCHAR line[CMDLINE_LENGTH];
|
||||||
|
|
||||||
TRACE ("cmd_call: (\'%s\')\n", debugstr_aw(param));
|
TRACE ("cmd_call: (\'%s\')\n", debugstr_aw(param));
|
||||||
if (!_tcsncmp (param, _T("/?"), 2))
|
if (!_tcsncmp (param, _T("/?"), 2))
|
||||||
{
|
{
|
||||||
|
@ -49,13 +46,22 @@ INT cmd_call (LPTSTR param)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Do a second round of %-variable substitutions */
|
||||||
|
if (!SubstituteVars(param, line, _T('%')))
|
||||||
|
return nErrorLevel = 1;
|
||||||
|
|
||||||
|
param = line;
|
||||||
|
while (_istspace(*param))
|
||||||
|
param++;
|
||||||
if (*param == _T(':') && (bc))
|
if (*param == _T(':') && (bc))
|
||||||
{
|
{
|
||||||
|
/* CALL :label - call a subroutine of the current batch file */
|
||||||
TCHAR *first = param;
|
TCHAR *first = param;
|
||||||
while (*param && !_istspace(*param))
|
while (*param && !_istspace(*param))
|
||||||
param++;
|
param++;
|
||||||
if (*param)
|
if (*param)
|
||||||
{
|
{
|
||||||
|
/* Separate label and arguments */
|
||||||
*param++ = _T('\0');
|
*param++ = _T('\0');
|
||||||
while (_istspace(*param))
|
while (_istspace(*param))
|
||||||
param++;
|
param++;
|
||||||
|
|
|
@ -102,6 +102,7 @@ BOOL ExecuteCommand(struct _PARSED_COMMAND *Cmd);
|
||||||
LPCTSTR GetEnvVarOrSpecial ( LPCTSTR varName );
|
LPCTSTR GetEnvVarOrSpecial ( LPCTSTR varName );
|
||||||
VOID AddBreakHandler (VOID);
|
VOID AddBreakHandler (VOID);
|
||||||
VOID RemoveBreakHandler (VOID);
|
VOID RemoveBreakHandler (VOID);
|
||||||
|
BOOL SubstituteVars(TCHAR *Src, TCHAR *Dest, TCHAR Delim);
|
||||||
BOOL SubstituteForVars(TCHAR *Src, TCHAR *Dest);
|
BOOL SubstituteForVars(TCHAR *Src, TCHAR *Dest);
|
||||||
LPTSTR DoDelayedExpansion(LPTSTR Line);
|
LPTSTR DoDelayedExpansion(LPTSTR Line);
|
||||||
BOOL DoCommand (LPTSTR line, struct _PARSED_COMMAND *Cmd);
|
BOOL DoCommand (LPTSTR line, struct _PARSED_COMMAND *Cmd);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue