classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Patch: File.getParent fixlet


From: Wolfgang Baer
Subject: [cp-patches] Patch: File.getParent fixlet
Date: Fri, 28 Oct 2005 20:47:36 +0200
User-agent: Debian Thunderbird 1.0.7 (X11/20051017)

Hi,

File.getParent fails with an Exception for a file with
a pathname of "".

A corresponding mauve test is send to mauve-patches.

2005-10-28  Wolfgang Baer  <address@hidden>

        * java/io/File.java
          (getParent): If pathname is "" return null.

Wolfgang
Index: java/io/File.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/io/File.java,v
retrieving revision 1.58
diff -u -r1.58 File.java
--- java/io/File.java   24 Oct 2005 06:44:19 -0000      1.58
+++ java/io/File.java   28 Oct 2005 18:42:26 -0000
@@ -543,6 +543,9 @@
   {
     String prefix = null;
     int nameSeqIndex = 0;
+    
+    if (path.equals(""))
+      return null;
 
     // The "prefix", if present, is the leading "/" on UNIX and 
     // either the drive specifier (e.g. "C:") or the leading "\\"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]