diff --git a/src/script/ant.bat b/src/script/ant.bat index aa8de1193..2b28ba0ae 100755 --- a/src/script/ant.bat +++ b/src/script/ant.bat @@ -2,7 +2,9 @@ if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat" -if not "%OS%"=="Windows_NT" goto start +if not "%OS%"=="Windows_NT" goto win9xStart +:winNTStart +@setlocal rem %~dp0 is name of current script under NT set DEFAULT_ANT_HOME=%~dp0 @@ -10,25 +12,28 @@ set DEFAULT_ANT_HOME=%~dp0 rem : operator works similar to make : operator set DEFAULT_ANT_HOME=%DEFAULT_ANT_HOME:\bin\=% -if "%ANT_HOME%"=="" set ANT_HOME=%DEFAULT_ANT_HOME% +if %ANT_HOME%a==a set ANT_HOME=%DEFAULT_ANT_HOME% set DEFAULT_ANT_HOME= -:start +rem On NT/2K grab all arguments at once +set ANT_CMD_LINE_ARGS=%* +goto doneStart +:win9xStart rem Slurp the command line arguments. This loop allows for an unlimited number of rem agruments (up to the command line limit, anyway). set ANT_CMD_LINE_ARGS= :setupArgs -if "%1"=="" goto doneArgs +if %1a==a goto doneStart set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1 shift goto setupArgs -:doneArgs -rem The doneArgs label is here just to provide a place for the argument list loop -rem to break out to. +:doneStart +rem This label provides a place for the argument list loop to break out +rem and for NT handling to skip to. rem find ANT_HOME if not "%ANT_HOME%"=="" goto checkJava @@ -80,7 +85,13 @@ goto end %_JAVACMD% -classpath %LOCALCLASSPATH% -Dant.home="%ANT_HOME%" -Djikes.class.path=%JIKESPATH% %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS% :end -if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat" set LOCALCLASSPATH= set ANT_CMD_LINE_ARGS= +if not "%OS%"=="Windows_NT" goto mainEnd +:winNTend +@endlocal + +:mainEnd +if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat" +