Skip to content

Commit

Permalink
Bug #616613: Automatically append the extension if user forgot append…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
cstim committed Aug 14, 2010
1 parent 0d99171 commit 044873e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/report/report-gnome/gnc-plugin-page-report.c
Expand Up @@ -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);

Expand Down

0 comments on commit 044873e

Please sign in to comment.