re PR java/9253 (on win32, java.io.File.listFiles("C:\\") returns pwd instead of...
authorRanjit Mathew <rmathew@hotmail.com>
Fri, 24 Jan 2003 21:57:00 +0000 (21:57 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Fri, 24 Jan 2003 21:57:00 +0000 (21:57 +0000)
2003-01-24  Ranjit Mathew  <rmathew@hotmail.com>

Fixes PR java/9253:
* java/io/natFileWin32.cc (performList): Append only "*.*"
if the canonical file path already has a "\" at the end.

From-SVN: r61736

libjava/ChangeLog
libjava/java/io/natFileWin32.cc

index 1b9a81ce5e28586bd3a09aaf0e2d2e2bd30521c0..36cac209702661c3f7444c64bf53437135392f59 100644 (file)
@@ -1,3 +1,9 @@
+2003-01-24  Ranjit Mathew  <rmathew@hotmail.com>
+
+       Fixes PR java/9253:
+       * java/io/natFileWin32.cc (performList): Append only "*.*"
+       if the canonical file path already has a "\" at the end.
+
 2003-01-24  Tom Tromey  <tromey@redhat.com>
 
        * defineclass.cc (handleMethodsEnd): Precompute code for static
index 9bf0eefb74e59d18d010c4372d0d83bb8dc36615..5245feb5a1e493dfbbb54db591eeff83a67b4a00 100644 (file)
@@ -146,8 +146,10 @@ java::io::File::performList (java::io::FilenameFilter *filter,
     return NULL;
   char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (canon) + 5);
   jsize total = JvGetStringUTFRegion (canon, 0, canon->length(), buf);
-  // FIXME?
-  strcpy(&buf[total], "\\*.*");
+  if (buf[total-1] == '\\')
+    strcpy (&buf[total], "*.*");
+  else
+    strcpy (&buf[total], "\\*.*");
 
   WIN32_FIND_DATA data;
   HANDLE handle = FindFirstFile (buf, &data);