GNOME Bugzilla – Bug 360058
GnuCash crashes on QIF-import after changing account's separator to * (asterisk)
Last modified: 2018-06-29 21:13:24 UTC
Steps to reproduce: 1.Edit->Preferences->Accounts->Separator Character change the existing character to * (asterisk) try to import any QIF -file into any account - the GnuCash window disappear 2. 3. Stack trace: arkadi@Gel-desktop:~/docs$ /usr/bin/gnucash& [1] 7806 arkadi@Gel-desktop:~/docs$ gnucash: [M] "Found Finance::Quote version ""1.11" Backtrace: In unknown file: ?: 0* [qif-import:update-stock-hash # # #] In /usr/share/gnucash/scm/qif-import/qif-dialog-utils.scm: 593: 1* (let ((names #)) (hash-fold (lambda # #) #f ...) ...) 594: 2* [hash-fold #<procedure #f (qif-name map-entry p)> #f ...] In unknown file: ?: 3* [#<procedure #f #> "in" # #f] In /usr/share/gnucash/scm/qif-import/qif-dialog-utils.scm: 596: 4* (let ((stock-name #)) (if (and stock-name # # ...) (let* # #)) #f) 596: 5* [qif-import:get-account-name "in"] 567: 6* (if (not qif-import:account-name-regexp) (let* # #)) 568: 7 (let* (# #) (set! qif-import:account-name-regexp #)) 572: 8 (set! qif-import:account-name-regexp (make-regexp newstr)) 572: 9* [gsubr-apply #<primitive-procedure make-regexp> "*([^*]+)$|^([^*]+)$"] /usr/share/gnucash/scm/qif-import/qif-dialog-utils.scm:572:46: In procedure make-regexp in expression (make-regexp newstr): /usr/share/gnucash/scm/qif-import/qif-dialog-utils.scm:572:46: Invalid preceding regular expression [1]+ Exit 2 /usr/bin/gnucash arkadi@Gel-desktop:~/docs$ Other information:
(Almost) Same issue as in bug#341414 although only in the '*' case it also will cause a crash.
Created attachment 103510 [details] [review] Proposed patch This patch fixes the bug by rewriting qif-import:get-account-name to avoid use of regular expressions. The new algorithm is simpler and faster anyway.
Created attachment 103586 [details] [review] Proposed patch (revised) A slight addition to the previous patch: I've removed the "use-modules (ice-9 regex)" call since it is no longer necessary.
Patch committed as r16949. Requesting backport for 2.2.4.
Applied to branches/2.2 as r16968 for GnuCash 2.2.4. Thanks a lot!
*** Bug 504248 has been marked as a duplicate of this bug. ***
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=360058. Please update any external references or bookmarks.