6987233: FileDialog.getDirectory() should add a trainling slash when GTK FileDialog is used
authoranthony
Mon, 04 Oct 2010 16:12:07 +0400
changeset 6644 ee35bd1e91f9
parent 6643 38c5b164e76b
child 6645 63ea2d282026
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
jdk/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java
--- 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);
         }