From 9503e68fba3a195b289bbb0cea06f29f1b9b65b7 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Fri, 3 Mar 2006 13:37:51 +0000 Subject: [PATCH] bug ID 32069: resetting an undefined env variable changes the errorlevel. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@382808 13f79535-47bb-0310-9956-ffa450edef68 --- src/script/ant.bat | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/script/ant.bat b/src/script/ant.bat index 3ab075167..26a8a3cdc 100755 --- a/src/script/ant.bat +++ b/src/script/ant.bat @@ -1,6 +1,6 @@ @echo off -REM Copyright 2001,2004-2005 The Apache Software Foundation +REM Copyright 2001,2004-2006 The Apache Software Foundation REM REM Licensed under the Apache License, Version 2.0 (the "License"); REM you may not use this file except in compliance with the License. @@ -14,6 +14,12 @@ REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. REM See the License for the specific language governing permissions and REM limitations under the License. +REM This is an inordinately troublesome piece of code, particularly because it +REM tries to work on both Win9x and WinNT-based systems. If we could abandon '9x +REM support, things would be much easier, but sadly, it is not yet time. +REM Be cautious about editing this, and only add WinNT specific stuff in code that +REM only runs on WinNT. + if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat" if "%OS%"=="Windows_NT" @setlocal @@ -149,7 +155,10 @@ set ANT_ERROR=%err100%%err10%%err1% for %%i in (1 10 100) do set err%%i= :end +rem bug ID 32069: resetting an undefined env variable changes the errorlevel. +set _JAVACMD=DUMMY_VAL set _JAVACMD= +set ANT_CMD_LINE_ARGS=DUMMY_VAL set ANT_CMD_LINE_ARGS= rem Set the return code if we are not in NT. We can only set