ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 42739] New: - Ant script may fail if CDPATH is set
Date Tue, 26 Jun 2007 09:07:04 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42739>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42739

           Summary: Ant script may fail if CDPATH is set
           Product: Ant
           Version: 1.7.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Wrapper scripts
        AssignedTo: dev@ant.apache.org
        ReportedBy: fbothamy@free.fr


If CDPATH is set (and /bin/sh is a link to /bin/bash), the following command
from the bin/ant script won't work correctly:

ANT_HOME=`cd "$ANT_HOME" && pwd`

as the cd command will already display the current working directory. The
ANT_HOME variable will then get the path twice (one from the cd, the other from
the pwd) (note: this only happens if ANT_HOME is a relative path, not an
absolute one).

The following patch will fix this potential minor problem:

--- ant~        2007-06-26 10:46:53.000000000 +0200
+++ ant 2007-06-25 18:37:05.000000000 +0200
@@ -106,7 +106,7 @@
   ANT_HOME=`dirname "$PRG"`/..
 
   # make it fully qualified
-  ANT_HOME=`cd "$ANT_HOME" && pwd`
+  ANT_HOME=`cd "$ANT_HOME" > /dev/null && pwd`
 fi
 
 # For Cygwin, ensure paths are in UNIX format before anything is touched

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message