From afc679f6adf40e9a1306aa838e3ca29acbbf40f4 Mon Sep 17 00:00:00 2001 From: Anthony Petrov Date: Mon, 4 Oct 2010 16:12:07 +0400 Subject: [PATCH] 6987233: FileDialog.getDirectory() should add a trainling slash when GTK FileDialog is used 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 ba2b78c4e0e..57a0492ddee 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); }