From 044873ee08e15f2a8205d89a07e842bdc60f1fb3 Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Sat, 14 Aug 2010 20:47:53 +0000 Subject: [PATCH] Bug #616613: Automatically append the extension if user forgot append them. Patch by "Bob": The enclosed patch simply tests for a period in the file name, if one exists it leaves it alone, if not, it adds one plus a default extension. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19429 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/report/report-gnome/gnc-plugin-page-report.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/report/report-gnome/gnc-plugin-page-report.c b/src/report/report-gnome/gnc-plugin-page-report.c index d8b4a630d1..badb1695c0 100644 --- a/src/report/report-gnome/gnc-plugin-page-report.c +++ b/src/report/report-gnome/gnc-plugin-page-report.c @@ -1406,6 +1406,10 @@ gnc_get_export_filename (SCM choice) filepath = gnc_file_dialog (title, NULL, default_dir, GNC_FILE_DIALOG_EXPORT); + /* Try to test for extension on file name, add if missing */ + if (g_strrstr(filepath,".") == NULL) + filepath = g_strconcat(filepath,".",g_ascii_strdown(type,strlen(type)),NULL); + g_free (title); g_free (default_dir);