aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRanjit Mathew <rmathew@hotmail.com>2003-01-24 21:57:00 +0000
committerTom Tromey <tromey@gcc.gnu.org>2003-01-24 21:57:00 +0000
commit0ced43354fe55cfeed8e70eefc1110209ffb8c5f (patch)
tree5744cb3ce8a7e666bd57a0020b2f569c94502fc8
parent1f37a5b273c35029f448d9c32277d42a45ff784f (diff)
downloadgcc-0ced43354fe55cfeed8e70eefc1110209ffb8c5f.zip
gcc-0ced43354fe55cfeed8e70eefc1110209ffb8c5f.tar.gz
gcc-0ced43354fe55cfeed8e70eefc1110209ffb8c5f.tar.bz2
re PR java/9253 (on win32, java.io.File.listFiles("C:\\") returns pwd instead of the root content of C:)
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
-rw-r--r--libjava/ChangeLog6
-rw-r--r--libjava/java/io/natFileWin32.cc6
2 files changed, 10 insertions, 2 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 1b9a81c..36cac20 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -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
diff --git a/libjava/java/io/natFileWin32.cc b/libjava/java/io/natFileWin32.cc
index 9bf0eef..5245feb5 100644
--- a/libjava/java/io/natFileWin32.cc
+++ b/libjava/java/io/natFileWin32.cc
@@ -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);