Add ".sav" or ".por" suffix to filename when saving with Save_As
authorBen Pfaff <blp@gnu.org>
Sat, 4 Oct 2008 04:11:20 +0000 (21:11 -0700)
committerBen Pfaff <blp@gnu.org>
Sat, 4 Oct 2008 04:11:20 +0000 (21:11 -0700)
Closes bug #23137

(This is a cross-port of commit 169887f6d6d7bf5c10d5b05786aa3fd252040c93
from the master branch, originally authored and committed by John
Darrington.)

src/ui/gui/data-editor.c

index 9ca7511e17d8eaf1dde47ab63b1cdd403fbf35b3..f7df21c752e746bec52f647f672db0082e387fba 100644 (file)
@@ -1375,6 +1375,11 @@ data_save_as_dialog (GtkAction *action, struct data_editor *de)
        de->save_as_portable =
          ! gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button_sys));
 
+       if ( de->save_as_portable)
+         append_filename_suffix (de, ".por");
+       else
+         append_filename_suffix (de, ".sav");
+
        save_file (de);
 
        window_set_name_from_filename (e, de->file_name);