mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +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:
+7
-13
@@ -337,10 +337,11 @@ INT Batch(LPTSTR fullname, LPTSTR firstword, LPTSTR param, PARSED_COMMAND *Cmd)
|
||||
*/
|
||||
bTopLevel = !bc;
|
||||
|
||||
if (bc != NULL && Cmd == bc->current)
|
||||
if (bc && Cmd == bc->current)
|
||||
{
|
||||
/* Then we are transferring to another batch */
|
||||
ClearBatch();
|
||||
if (!bSameFn)
|
||||
ClearBatch();
|
||||
AddBatchRedirection(&Cmd->Redirections);
|
||||
}
|
||||
else
|
||||
@@ -408,17 +409,10 @@ INT Batch(LPTSTR fullname, LPTSTR firstword, LPTSTR param, PARSED_COMMAND *Cmd)
|
||||
/* Perform top-level batch initialization */
|
||||
if (bTopLevel)
|
||||
{
|
||||
TCHAR *dot;
|
||||
|
||||
/* Default the top-level batch context type to .BAT */
|
||||
BatType = 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;
|
||||
}
|
||||
/* Default the top-level batch context type
|
||||
* to .BAT, unless this is a .CMD file */
|
||||
PTCHAR dotext = _tcsrchr(bc->BatchFilePath, _T('.'));
|
||||
BatType = (dotext && (!_tcsicmp(dotext, _T(".cmd")))) ? CMD_TYPE : BAT_TYPE;
|
||||
|
||||
#ifdef MSCMD_BATCH_ECHO
|
||||
bBcEcho = bEcho;
|
||||
|
||||
Reference in New Issue
Block a user