mirror of
https://github.com/reactos/reactos.git
synced 2024-09-20 01:31:34 +00:00
[CMD] Batch: Don't ClearBatch if bSameFn (#7112)
Recursing batch was prevented by ClearBatch call. JIRA issue: CORE-18093 - Check bSameFn variable. - If it was TRUE, don't call ClearBatch function.
This commit is contained in:
parent
39305cc79c
commit
ec2721fd3e
|
@ -337,9 +337,10 @@ INT Batch(LPTSTR fullname, LPTSTR firstword, LPTSTR param, PARSED_COMMAND *Cmd)
|
||||||
*/
|
*/
|
||||||
bTopLevel = !bc;
|
bTopLevel = !bc;
|
||||||
|
|
||||||
if (bc != NULL && Cmd == bc->current)
|
if (bc && Cmd == bc->current)
|
||||||
{
|
{
|
||||||
/* Then we are transferring to another batch */
|
/* Then we are transferring to another batch */
|
||||||
|
if (!bSameFn)
|
||||||
ClearBatch();
|
ClearBatch();
|
||||||
AddBatchRedirection(&Cmd->Redirections);
|
AddBatchRedirection(&Cmd->Redirections);
|
||||||
}
|
}
|
||||||
|
@ -408,17 +409,10 @@ INT Batch(LPTSTR fullname, LPTSTR firstword, LPTSTR param, PARSED_COMMAND *Cmd)
|
||||||
/* Perform top-level batch initialization */
|
/* Perform top-level batch initialization */
|
||||||
if (bTopLevel)
|
if (bTopLevel)
|
||||||
{
|
{
|
||||||
TCHAR *dot;
|
/* Default the top-level batch context type
|
||||||
|
* to .BAT, unless this is a .CMD file */
|
||||||
/* Default the top-level batch context type to .BAT */
|
PTCHAR dotext = _tcsrchr(bc->BatchFilePath, _T('.'));
|
||||||
BatType = BAT_TYPE;
|
BatType = (dotext && (!_tcsicmp(dotext, _T(".cmd")))) ? CMD_TYPE : BAT_TYPE;
|
||||||
|
|
||||||
/* If this is a .CMD file, adjust the type */
|
|
||||||
dot = _tcsrchr(bc->BatchFilePath, _T('.'));
|
|
||||||
if (dot && (!_tcsicmp(dot, _T(".cmd"))))
|
|
||||||
{
|
|
||||||
BatType = CMD_TYPE;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef MSCMD_BATCH_ECHO
|
#ifdef MSCMD_BATCH_ECHO
|
||||||
bBcEcho = bEcho;
|
bBcEcho = bEcho;
|
||||||
|
|
Loading…
Reference in a new issue