From 38c9ee8896a206ec78a71e810b4402631ad373b7 Mon Sep 17 00:00:00 2001 From: Rostislav Krasny <45571812+rosti-il@users.noreply.github.com> Date: Wed, 1 Jan 2020 01:07:26 +0200 Subject: [PATCH] Prevent printing the EXEC_DIR when it's just a disk letter This fixes following bug and also consistent with another 'cd /d "%EXEC_DIR%"' a few lines above. When you're on the root of some disk running mvn.cmd prints an extra line with current dir before the correct output. For example: D:\>mvn -version D:\ Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: D:\develop\apache-maven-3.6.3\bin\.. Java version: 11.0.5, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-11.0.5 Default locale: en_US, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows" --- apache-maven/src/bin/mvn.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apache-maven/src/bin/mvn.cmd b/apache-maven/src/bin/mvn.cmd index fd1b21e3f9bb..0b38157a796f 100644 --- a/apache-maven/src/bin/mvn.cmd +++ b/apache-maven/src/bin/mvn.cmd @@ -156,7 +156,7 @@ goto endDetectBaseDir :baseDirNotFound if "_%EXEC_DIR:~-1%"=="_\" set "EXEC_DIR=%EXEC_DIR:~0,-1%" set "MAVEN_PROJECTBASEDIR=%EXEC_DIR%" -cd "%EXEC_DIR%" +cd /d "%EXEC_DIR%" :endDetectBaseDir