mirror of
https://github.com/reactos/reactos.git
synced 2025-07-23 04:43:47 +00:00
support blocks ( ... )
support parsing of env vars like %TIMERAW:~0,2% there is still room for improvement... svn path=/trunk/; revision=31903
This commit is contained in:
parent
95ed37888e
commit
67ed022d72
4 changed files with 68 additions and 12 deletions
|
@ -272,6 +272,7 @@ BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param)
|
|||
SetFilePointer (bc->hBatchFile, 0, NULL, FILE_BEGIN);
|
||||
bc->bEcho = bEcho; /* Preserve echo across batch calls */
|
||||
bc->shiftlevel = 0;
|
||||
bc->bCmdBlock = FALSE;
|
||||
|
||||
bc->ffind = NULL;
|
||||
bc->forvar = _T('\0');
|
||||
|
@ -453,6 +454,18 @@ LPTSTR ReadBatchLine (LPBOOL bLocalEcho)
|
|||
|
||||
*++ip = _T('\0');
|
||||
|
||||
/* cmd block over multiple lines (..) */
|
||||
if (bc->bCmdBlock)
|
||||
{
|
||||
if (*first == _T(')'))
|
||||
{
|
||||
bc->bCmdBlock = FALSE;
|
||||
continue;
|
||||
}
|
||||
if (!bc->bExecuteBlock)
|
||||
continue;
|
||||
}
|
||||
|
||||
/* ignore labels and empty lines */
|
||||
if (*first == _T(':') || *first == 0)
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue