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 <[EMAIL PROTECTED]>
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 &&