From b706854c2172afdbf6d99fa3b790ecaaa7369640 Mon Sep 17 00:00:00 2001 From: Matthew Jason Benson Date: Thu, 6 May 2004 16:42:18 +0000 Subject: [PATCH] Cygwin/UNC ANT_HOME compatibility using mixed paths on NT-family systems. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276434 13f79535-47bb-0310-9956-ffa450edef68 --- src/script/ant | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/script/ant b/src/script/ant index 4f28a909b..ed25ebd1d 100644 --- a/src/script/ant +++ b/src/script/ant @@ -222,13 +222,19 @@ if $usejikes; then ANT_OPTS="$ANT_OPTS -Dbuild.compiler=jikes" fi -# For Cygwin, switch paths to Windows format before running java +# For Cygwin, switch paths to appropriate format before running java if $cygwin; then - ANT_HOME=`cygpath --windows "$ANT_HOME"` - ANT_LIB=`cygpath --windows "$ANT_LIB"` - JAVA_HOME=`cygpath --windows "$JAVA_HOME"` - LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"` - CYGHOME=`cygpath --windows "$HOME"` + if [ "$OS" = "Windows_NT" ] ; then + format=mixed + else + format=windows + fi + ANT_HOME=`cygpath --$format "$ANT_HOME"` + ANT_LIB=`cygpath --$format "$ANT_LIB"` + JAVA_HOME=`cygpath --$format "$JAVA_HOME"` + LOCALCLASSPATH=`cygpath --path --$format "$LOCALCLASSPATH"` + CLASSPATH=`cygpath --path --$format "$OCALCLASSPATH"` + CYGHOME=`cygpath --$format "$HOME"` fi # Show script help if requested @@ -247,6 +253,11 @@ if $show_help ; then fi # add a second backslash to variables terminated by a backslash under cygwin if $cygwin; then + case "$ANT_HOME" in + *\\ ) + ANT_HOME="$ANT_HOME\\" + ;; + esac case "$CYGHOME" in *\\ ) CYGHOME="$CYGHOME\\"