6987233: FileDialog.getDirectory() should add a trainling slash when GTK FileDialog is used
Summary: Add the trailing slash if it's absent
Reviewed-by: art, dcherepanov
--- a/jdk/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java Mon Oct 04 11:40:07 2010 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java Mon Oct 04 16:12:07 2010 +0400
@@ -64,7 +64,10 @@
accessor.setFile(fd, null);
accessor.setFiles(fd, null, null);
} else {
- accessor.setDirectory(fd, directory);
+ // Fix 6987233: add the trailing slash if it's absent
+ accessor.setDirectory(fd, directory +
+ (directory.endsWith(File.separator) ?
+ "" : File.separator));
accessor.setFile(fd, filenames[0]);
accessor.setFiles(fd, directory, filenames);
}