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
This commit is contained in:
Anthony Petrov 2010-10-04 16:12:07 +04:00
parent fbb62aa566
commit afc679f6ad

View File

@ -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);
}