* src/backend/file/gnc-backend-file.c: Apply sam's patch:

don't allow selection of directory for save file


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8649 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Derek Atkins
2003-06-22 23:48:47 +00:00
parent 5d0011374d
commit 7e19cbd393
2 changed files with 11 additions and 0 deletions

View File

@@ -4,6 +4,9 @@
reverse the balances of accounts instead of using the internal
functions to determine when to reverse. Fixes #115268.
* src/backend/file/gnc-backend-file.c: Apply sam's patch:
don't allow selection of directory for save file
2003-06-19 Chris Lyttle <chris@wilddev.net>
* src/scm/help-topics-index.scm: add Jon Lapham's patch

View File

@@ -117,6 +117,14 @@ file_session_begin(Backend *be_start, GNCSession *session, const char *book_id,
g_free (be->dirname); be->dirname = NULL;
return;
}
rc = stat (be->fullpath, &statbuf);
if (rc != 0 || S_ISDIR(statbuf.st_mode))
{
xaccBackendSetError (be_start, ERR_FILEIO_UNKNOWN_FILE_TYPE);
g_free (be->fullpath); be->fullpath = NULL;
g_free (be->dirname); be->dirname = NULL;
return;
}
}
/* ---------------------------------------------------- */