changeset 2918:a014255d826c

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
author anthony
date Mon, 04 Oct 2010 16:12:07 +0400
parents 70a73fc061d9
children d147113a36fd
files src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java	Mon Oct 04 11:40:07 2010 +0400
+++ b/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);
         }