From 922ace51f86e91979e39a303d55d5a75fe2f05b0 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sat, 20 Dec 2008 11:08:27 +0000 Subject: [PATCH] [MNG-3930] mvn.bat doesn't handle ampersand in Windows user name properly o Merged from r728264 git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@728267 13f79535-47bb-0310-9956-ffa450edef68 --- maven-distribution/src/bin/mvn.bat | 14 +++++++------- maven-distribution/src/bin/mvnDebug.bat | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/maven-distribution/src/bin/mvn.bat b/maven-distribution/src/bin/mvn.bat index 5262dc5e2a..5532c5995f 100644 --- a/maven-distribution/src/bin/mvn.bat +++ b/maven-distribution/src/bin/mvn.bat @@ -38,7 +38,7 @@ @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% @REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set HOME=%HOMEDRIVE%%HOMEPATH%) +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") @REM Execute a user defined script before this one if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" @@ -64,7 +64,7 @@ if exist "%JAVA_HOME%\bin\java.exe" goto chkMHome echo. echo ERROR: JAVA_HOME is set to an invalid directory. -echo JAVA_HOME = %JAVA_HOME% +echo JAVA_HOME = "%JAVA_HOME%" echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation echo. @@ -73,8 +73,8 @@ goto error :chkMHome if not "%M2_HOME%"=="" goto valMHome -if "%OS%"=="Windows_NT" SET M2_HOME=%~dp0.. -if "%OS%"=="WINNT" SET M2_HOME=%~dp0.. +if "%OS%"=="Windows_NT" SET "M2_HOME=%~dp0.." +if "%OS%"=="WINNT" SET "M2_HOME=%~dp0.." if not "%M2_HOME%"=="" goto valMHome echo. @@ -87,8 +87,8 @@ goto error :valMHome :stripMHome -if not _%M2_HOME:~-1%==_\ goto checkMBat -set M2_HOME=%M2_HOME:~0,-1% +if not "_%M2_HOME:~-1%"=="_\" goto checkMBat +set "M2_HOME=%M2_HOME:~0,-1%" goto stripMHome :checkMBat @@ -96,7 +96,7 @@ if exist "%M2_HOME%\bin\mvn.bat" goto init echo. echo ERROR: M2_HOME is set to an invalid directory. -echo M2_HOME = %M2_HOME% +echo M2_HOME = "%M2_HOME%" echo Please set the M2_HOME variable in your environment to match the echo location of the Maven installation echo. diff --git a/maven-distribution/src/bin/mvnDebug.bat b/maven-distribution/src/bin/mvnDebug.bat index 891b27359b..e44cb2e31e 100644 --- a/maven-distribution/src/bin/mvnDebug.bat +++ b/maven-distribution/src/bin/mvnDebug.bat @@ -41,7 +41,7 @@ set INT_MAVEN_OPTS=%MAVEN_OPTS% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% @REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set HOME=%HOMEDRIVE%%HOMEPATH%) +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") @REM Execute a user defined script before this one if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" @@ -67,7 +67,7 @@ if exist "%JAVA_HOME%\bin\java.exe" goto chkMHome echo. echo ERROR: JAVA_HOME is set to an invalid directory. -echo JAVA_HOME = %JAVA_HOME% +echo JAVA_HOME = "%JAVA_HOME%" echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation echo. @@ -76,8 +76,8 @@ goto error :chkMHome if not "%M2_HOME%"=="" goto valMHome -if "%OS%"=="Windows_NT" SET M2_HOME=%~dp0.. -if "%OS%"=="WINNT" SET M2_HOME=%~dp0.. +if "%OS%"=="Windows_NT" SET "M2_HOME=%~dp0.." +if "%OS%"=="WINNT" SET "M2_HOME=%~dp0.." if not "%M2_HOME%"=="" goto valMHome echo. @@ -90,8 +90,8 @@ goto error :valMHome :stripMHome -if not _%M2_HOME:~-1%==_\ goto checkMBat -set M2_HOME=%M2_HOME:~0,-1% +if not "_%M2_HOME:~-1%"=="_\" goto checkMBat +set "M2_HOME=%M2_HOME:~0,-1%" goto stripMHome :checkMBat @@ -99,7 +99,7 @@ if exist "%M2_HOME%\bin\mvn.bat" goto init echo. echo ERROR: M2_HOME is set to an invalid directory. -echo M2_HOME = %M2_HOME% +echo M2_HOME = "%M2_HOME%" echo Please set the M2_HOME variable in your environment to match the echo location of the Maven installation echo.