ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant Project.java
Date Wed, 04 Oct 2000 09:57:55 GMT
bodewig     00/10/04 02:57:55

  Modified:    src/main/org/apache/tools/ant Project.java
  Log:
  Made sure that Project.resolveFile would always use the canonical path
  of a file.
  Submitted by:	Adam Murdoch <adammurdoch@yahoo.com>
  
  Revision  Changes    Path
  1.43      +9 -2      jakarta-ant/src/main/org/apache/tools/ant/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- Project.java	2000/09/26 11:05:43	1.42
  +++ Project.java	2000/10/04 09:57:55	1.43
  @@ -537,8 +537,15 @@
           fileName = fileName.replace('/', File.separatorChar).replace('\\', File.separatorChar);
   
           // deal with absolute files
  -        if (fileName.startsWith(File.separator)) 
  -            return new File( fileName );
  +        if (fileName.startsWith(File.separator)) {
  +            try {
  +                return new File(new File(fileName).getCanonicalPath());
  +            } catch (IOException e) {
  +                log("IOException getting canonical path for " + fileName 
  +                    + ": " + e.getMessage(), MSG_ERR);
  +                return new File(fileName);
  +            }
  +        }
   
           // Eliminate consecutive slashes after the drive spec
           if (fileName.length() >= 2 &&
  
  
  

Mime
View raw message