Index: maven.bat
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/bin/maven.bat,v
retrieving revision 1.14
diff -u -u -r1.14 maven.bat
--- maven.bat	14 Aug 2002 12:40:31 -0000	1.14
+++ maven.bat	20 Aug 2002 03:49:44 -0000
@@ -2,8 +2,6 @@
 
 REM ----------------------------------------------------------------------------
 REM Maven Windows Batch script
-REM   - This script has known windows compatibility issues:
-REM     - '%*' only works on NT/2000/XP, not on 95/98/ME
 REM ----------------------------------------------------------------------------
 
 if "%MAVEN_HOME%" == "" goto error_maven
@@ -18,7 +16,42 @@
 SET MAVEN_CLASSPATH="%MAVEN_HOME%\lib\forehead-1.0-beta-4.jar"
 SET MAVEN_MAIN=com.werken.forehead.Forehead
 
-%JAVA% %MAVEN_OPTS% -classpath %MAVEN_CLASSPATH% %MAVEN_MAIN%  %*
+
+REM -- Set up command line args according to the OS present
+
+if not "%OS%"=="Windows_NT" goto win9x_start
+:winNT_start
+@setlocal
+
+REM -- Need to check if we are using the 4NT shell...
+if "%eval[2+2]" == "4" goto setup_4NT
+
+REM -- On NT/2K grab all arguments at once
+set MAVEN_CMD_LINE_ARGS=%*
+goto done_start
+
+:setup_4NT
+set MAVEN_CMD_LINE_ARGS=%$
+goto done_start
+
+:win9x_start
+REM -- Slurp the command line arguments.  This loop allows for an unlimited
+REM -- number of agruments (up to the command line limit, anyway).
+
+set MAVEN_CMD_LINE_ARGS=
+
+:setup_args
+if %1a==a goto done_start
+set MAVEN_CMD_LINE_ARGS=%MAVEN_CMD_LINE_ARGS% %1
+shift
+goto setup_args
+
+:done_start
+REM -- This label provides a place for the argument list loop to break out 
+REM -- and for NT handling to skip to.
+
+
+%JAVA% %MAVEN_OPTS% -classpath %MAVEN_CLASSPATH% %MAVEN_MAIN%  %MAVEN_CMD_LINE_ARGS%
 goto end
 
 :error_maven
@@ -27,7 +60,7 @@
 echo Please, set the MAVEN_HOME variable in your environment to match the
 echo location of the Maven installation
 
-goto end
+goto main_end
 
 :error_java
 
@@ -35,6 +68,12 @@
 echo Please, set the JAVA_HOME variable in your environment to match the
 echo location of the Java installation
 
-goto end
+goto main_end
 
 :end
+
+set MAVEN_CMD_LINE_ARGS=
+if not "%OS%"=="Windows_NT" goto main_end
+@endlocal
+
+:main_end

