translate %errorlevel% to a value when it pass at command line. Now is errorlevel implement as it should. left todo check all cmd command that they are setting right value

svn path=/trunk/; revision=16452
This commit is contained in:
Magnus Olsen 2005-07-06 12:20:57 +00:00
parent 9254444a9c
commit 04480b3be7

View file

@ -134,6 +134,9 @@
*
* 06-May-2005 (Klemens Friedl <frik85@gmail.com>)
* Add 'help' command (list all commands plus description)
*
* 06-jul-2005 (Magnus Olsen <magnus@greatlord.com>)
* translate '%errorlevel%' to the internal value.
*/
#include "precomp.h"
@ -985,8 +988,17 @@ ProcessInput (BOOL bFlag)
/* FIXME: This is just a quick hack!! */
/* Do a proper memory allocation!! */
if (GetEnvironmentVariable (ip, evar, 512))
if (_tcsicmp(ip,_T("errorlevel")) ==0)
{
memset(evar,0,512 * sizeof(TCHAR));
_itot(nErrorLevel,evar,10);
cp = _stpcpy (cp, evar);
}
else if (GetEnvironmentVariable (ip, evar, 512))
{
cp = _stpcpy (cp, evar);
}
ip = tp + 1;
}
@ -994,11 +1006,15 @@ ProcessInput (BOOL bFlag)
{
*cp++ = _T('%');
}
break;
}
continue;
}
if (_istcntrl (*ip))
*ip = _T(' ');
*cp++ = *ip++;