AUDIT: r20549 - gnucash/trunk/src/report/report-system - Bug #647316: Fix crash when deleting custom report if no backup file existed.
Christian Stimming
cstim at code.gnucash.org
Sat Apr 9 17:34:13 EDT 2011
Author: cstim
Date: 2011-04-09 17:34:13 -0400 (Sat, 09 Apr 2011)
New Revision: 20549
Trac: http://svn.gnucash.org/trac/changeset/20549
Modified:
gnucash/trunk/src/report/report-system/report.scm
Log:
Bug #647316: Fix crash when deleting custom report if no backup file existed.
Before deleting the backup file by (delete-file), it must be checked
whether the to-be-deleted file exists, otherwise the guile procedure
will crash.
BP
Modified: gnucash/trunk/src/report/report-system/report.scm
===================================================================
--- gnucash/trunk/src/report/report-system/report.scm 2011-04-09 20:18:46 UTC (rev 20548)
+++ gnucash/trunk/src/report/report-system/report.scm 2011-04-09 21:34:13 UTC (rev 20549)
@@ -618,7 +618,8 @@
(let ((temp-path (gnc-build-dotgnucash-path "saved-reports-2.4-backup")))
(gnc:debug "saving all reports...")
;; On windows, it seems to crash if we try to rename without deleting the old file first.
- (delete-file temp-path)
+ (if (access? temp-path F_OK)
+ (delete-file temp-path))
(rename-file gnc:current-saved-reports temp-path)
(hash-for-each (lambda (k v)
(if (gnc:report-template-parent-type v)
More information about the gnucash-changes
mailing list