-
Bug
-
Resolution: Not an Issue
-
P2
-
None
-
1.1.6
-
x86
-
windows_nt
Name: diC59631 Date: 07/16/98
This is from Oracle, a Java licensee.
The Oracle bug number is 697684.
This bug did occur with JDK 1.1.6, but didn't occur with JDK1.1.4 and 1.1.5.
Please consider this a regression problem, and examine it ASAP.
The directory dialog does not show the directories under the current drive
where it is invoked from. This happens only on NT, with JDK1.1.6. If the
current directory is not the root(like c:\) then you would see the problem.
Rest of the drives show up correctly.
Example:
If you are invoking the directory dialog say from c:\temp\one, the list()
method in FileUtils looks for the files that are present under c:\temp\one
under c:\, instead of looking for the files that are there under c:\ itself.
Since the test case to reproduce this bug need some dll and jar files,
please see the Javasoft contact persons to get the test case.
The fix for this problem is:
change the code below in function DIR* opendir(const char *dirname) under file dirent.c
if (dirp->path[1] == ':'
&& (dirp->path[2] == '\0'
|| (dirp->path[2] == '\\' && dirp->path[3] == '\0'))) {
/* No '\\' needed for cases like "Z:" or "Z:\" */
strcat(dirp->path, "*.*"); } else {
strcat(dirp->path, "\\*.*"); }
to:
if (!alt_dirname[1]) {
strcat(dirp->path, "\\*.*");
} else {
strcat(dirp->path, "*.*");
}
(Review ID: 34928)
======================================================================
More information from licensee:
The attachment zip file contains test case that you want. The b697681.txt
file inside the zip file has the steps to reproduce this bug. It should be
readable. If you have any questions regarding it, please let me know.
The problem is happened under src\win32\java\runtime\dirent.c NOT the
java.io.File.list method. The function name is:
DIR* opendir(const char *dirname)
the code is:
if (dirp->path[1] == ':'
&& (dirp->path[2] == '\0'
|| (dirp->path[2] == '\\' && dirp->path[3] == '\0'))) {
/* No '\\' needed for cases like "Z:" or "Z:\" */
strcat(dirp->path, "*.*"); } else {
strcat(dirp->path, "\\*.*"); }
it should be:
if (dirp->path[1] == ':'
&& (dirp->path[2] == '\0'
|| (dirp->path[2] == '\\' && dirp->path[3] == '\0'))) {
/* No '\\' needed for cases like "Z:" or "Z:\" */
strcat(dirp->path, "\\*.*"); } else {
strcat(dirp->path, "*.*"); }
The attached file, b697681.zip, contains a reproducible test case.
marianne.mueller@Eng 1998-07-28
=============================================================================
As requested, a smaller test case for this bug is attached to
the bug report in 4157878_test_case.zip.
That file contains
puffin% total 2474
-rw-rw-r-- 1 mrm green 4600 Sep 2 14:55 Test.class
-rw-rw-r-- 1 mrm green 5775 Sep 2 14:47 Test.java
-rw-rw-r-- 1 mrm green 520 Sep 2 15:09 b697681.txt
-rw-rw-r-- 1 mrm green 1238646 Aug 6 09:14 ewt-opt-3_1_0.zip
-rw-rw-r-- 1 mrm green 119 Sep 2 15:04 run.bat
puffin%
The EWT is Oracle's graphics components toolkit.
marianne.mueller@Eng 1998-09-08
=============================================================================