You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by mb...@apache.org on 2005/02/01 00:50:49 UTC

cvs commit: ant/src/main/org/apache/tools/ant/util FileUtils.java

mbenson     2005/01/31 15:50:48

  Modified:    src/main/org/apache/tools/ant/util Tag: ANT_16_BRANCH
                        FileUtils.java
  Log:
  Merge
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.56.2.9  +8 -4      ant/src/main/org/apache/tools/ant/util/FileUtils.java
  
  Index: FileUtils.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/FileUtils.java,v
  retrieving revision 1.56.2.8
  retrieving revision 1.56.2.9
  diff -u -r1.56.2.8 -r1.56.2.9
  --- FileUtils.java	26 Jan 2005 17:31:04 -0000	1.56.2.8
  +++ FileUtils.java	31 Jan 2005 23:50:48 -0000	1.56.2.9
  @@ -713,7 +713,7 @@
        * @param filename the file name to be checked for being an absolute path.
        * @return true if the filename represents an absolute path.
        */
  -    private static boolean isAbsolutePath(String filename) {
  +    public static boolean isAbsolutePath(String filename) {
           if (filename.startsWith(File.separator)) {
               // common for all os
               return true;
  @@ -1164,8 +1164,12 @@
        */
       public boolean isSymbolicLink(File parent, String name)
           throws IOException {
  -        File toTest = new File(((parent == null)
  -            ? null : parent.getCanonicalPath()), name);
  +        if (parent == null) {
  +            File f = new File(name);
  +            parent = f.getParentFile();
  +            name = f.getName();
  +        }
  +        File toTest = new File(parent.getCanonicalPath(), name);
           return !toTest.getAbsolutePath().equals(toTest.getCanonicalPath());
       }
   
  
  
  

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