re PR libgcj/6652 (new java.io.File("").getCanonicalFile() throws exception)

PR libgcj/6652:
	* java/io/natFileWin32.cc (getCanonicalPath): Treat "" like ".".

From-SVN: r73115
This commit is contained in:
Mohan Embar 2003-10-31 03:02:47 +00:00 committed by Mohan Embar
parent 9373164a48
commit b82183ab3f
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2003-10-30 Mohan Embar <gnustuff@thisiscool.com>
PR libgcj/6652:
* java/io/natFileWin32.cc (getCanonicalPath): Treat "" like ".".
2003-10-30 Bryce McKinlay <bryce@mckinlay.net.nz>
* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Don't use vtable

View File

@ -109,10 +109,15 @@ jstring
java::io::File::getCanonicalPath (void)
{
JV_TEMP_UTF_STRING (cpath, path);
// If the filename is blank, use the current directory.
const char* thepath = cpath.buf();
if (*thepath == '\0')
thepath = ".";
LPTSTR unused;
char buf2[MAX_PATH];
if(!GetFullPathName(cpath, MAX_PATH, buf2, &unused))
if(!GetFullPathName(thepath, MAX_PATH, buf2, &unused))
throw new IOException (JvNewStringLatin1 ("GetFullPathName failed"));
// FIXME: what encoding to assume for file names? This affects many