changeset 28117:9fa9af3f0ca7

(Fread_file_name): Handle case that DIR contains a file name.
author Gerd Moellmann <gerd@gnu.org>
date Sun, 12 Mar 2000 16:23:35 +0000
parents 25edeaccc41f
children 864231b74663
files src/fileio.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/fileio.c	Sun Mar 12 16:22:19 2000 +0000
+++ b/src/fileio.c	Sun Mar 12 16:23:35 2000 +0000
@@ -5596,6 +5596,15 @@
       && use_dialog_box
       && have_menus_p ())
     {
+      /* If DIR contains a file name, split it.  */
+      Lisp_Object file;
+      file = Ffile_name_nondirectory (dir);
+      if (XSTRING (file)->size && NILP (default_filename))
+	{
+	  default_filename = file;
+	  dir = Ffile_name_directory (dir);
+	}
+      default_filename = Fexpand_file_name (default_filename, dir);
       val = Fx_file_dialog (prompt, dir, default_filename, mustmatch);
       add_to_history = 1;
     }