From c54dcbcd1eece5ef3da75e640ba669309b1ba7ab Mon Sep 17 00:00:00 2001 From: anthony Date: Mon, 4 Oct 2010 16:12:07 +0400 Subject: [PATCH] 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jdk/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java b/jdk/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java index ba2b78c4e0..57a0492dde 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java @@ -64,7 +64,10 @@ class GtkFileDialogPeer extends XDialogPeer implements FileDialogPeer { 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); } -- GitLab