support else

handle negative values in special envvars
stdin,out,err can't be redirected for windows gui apps

svn path=/trunk/; revision=32068
This commit is contained in:
Christoph von Wittich 2008-01-31 17:59:02 +00:00
parent 00e33fbce3
commit 11ca34b0e3
2 changed files with 42 additions and 14 deletions

View file

@ -458,10 +458,21 @@ LPTSTR ReadBatchLine (LPBOOL bLocalEcho)
{
if (*first == _T(')'))
{
bc->bCmdBlock--;
first++;
/* Strip leading spaces and trailing space/control chars */
while(_istspace (*first))
first++;
if ((_tcsncicmp (first, _T("else"), 4) == 0) && (_tcschr(first, _T('('))))
{
bc->bExecuteBlock[bc->bCmdBlock] = !bc->bExecuteBlock[bc->bCmdBlock];
}
else
{
bc->bCmdBlock--;
}
continue;
}
if ((bc->bCmdBlock >= 0) && (bc->bCmdBlock < MAX_PATH))
if (bc->bCmdBlock < MAX_PATH)
if (!bc->bExecuteBlock[bc->bCmdBlock])
{
/* increase the bCmdBlock count when there is another conditon which opens a new bracket */