2003-01-24 Ranjit Mathew <rmathew@hotmail.com>
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Jan 2003 21:57:00 +0000 (21:57 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Jan 2003 21:57:00 +0000 (21:57 +0000)
Fixes PR java/9253:
* java/io/natFileWin32.cc (performList): Append only "*.*"
if the canonical file path already has a "\" at the end.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61736 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 1b9a81c..36cac20 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 9bf0eef..5245feb 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);