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
This commit is contained in:
Christian Stimming 2010-08-14 20:47:53 +00:00
parent 0d9917127f
commit 044873ee08

View File

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