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 26765] - "-f" option works incorrectly if path includes "../"
Date Wed, 10 Mar 2004 10:00:53 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=26765>.
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=26765

"-f" option works incorrectly if path includes "../"

peter.reilly@corvil.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |1.6.2



------- Additional Comments From peter.reilly@corvil.com  2004-03-10 10:00 -------
I got this problem to happen:
a build file containing:
<project basedir="../..">
  <echo>basedir is "${basedir}"</echo>
</project>

~/learning/a/dotdot/j/src/ca/gorman/io > ant -f build.xml
basedir is "/home/preilly/learning/a/dotdot/j/src/ca"
~/learning/a/dotdot/j/src/ca/gorman/io > ant -f ../io/build.xml
basedir is "/home/preilly/learning/a/dotdot/j/src/ca/gorman/io"

The problem is that ProjectHelper2 uses File#getAbsolutePath().
getAbsolutePath() does not resolve .. and . in the filename, so
later when FileUtils.resolveFile is used, it generates an incorrect
path.

The solution was to call FileUtils#normalize() on the filename.

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


Mime
View raw message