ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 32069] New: - ant.bat corrupts ant exit status on WinXP SP2
Date Thu, 04 Nov 2004 22:34:55 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32069>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32069

ant.bat corrupts ant exit status on WinXP SP2

           Summary: ant.bat corrupts ant exit status on WinXP SP2
           Product: Ant
           Version: 1.6.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Wrapper scripts
        AssignedTo: dev@ant.apache.org
        ReportedBy: charles.butterfield@nextcentury.com


For ant 1.6.2 on WinXP SP2, I noticed that the exit status is corrupted 
(changed from 0 to 1) if no command line args are specified.  It appears that 
the act of unsetting _JAVACMD changes ERRORLEVEL (to 1) if and only if the 
variable was not previous set.

My fix was to forcibly set the two variables being erased just prior to 
erasing them.  It's pretty ugly, maybe there is a better way. I don't know if 
there are side-effects on other versions of Windows.

FYI - here is how I patched my ant.bat file:
...
:end
:: BUGFIX/CB: (under WinXP at least), erasing a shell variable that was never
:: set appears to modify ERRORLEVEL (it sets it to 1, perhaps to indicate that
:: the erase was erroneous/unneeded).  So we set each var to a DUMMY value to
:: preserve the ant exit status.
set _JAVACMD=DUMMY_VAL
set _JAVACMD=
set ANT_CMD_LINE_ARGS=DUMMY_VAL
set ANT_CMD_LINE_ARGS=
...

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message