gnucash maint: Bug 797378 - QIF file import fails: Loading gives wrong type argument in position 2
Christopher Lam
clam at code.gnucash.org
Thu Aug 29 08:19:42 EDT 2019
Updated via https://github.com/Gnucash/gnucash/commit/bb4348fc (commit)
from https://github.com/Gnucash/gnucash/commit/d4379644 (commit)
commit bb4348fce97668af5de08e0a38867437d7e7f81f
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Thu Aug 29 20:08:18 2019 +0800
Bug 797378 - QIF file import fails: Loading gives wrong type argument in position 2
diff --git a/gnucash/import-export/qif-imp/qif-parse.scm b/gnucash/import-export/qif-imp/qif-parse.scm
index 61fa160ec..c79959f91 100644
--- a/gnucash/import-export/qif-imp/qif-parse.scm
+++ b/gnucash/import-export/qif-imp/qif-parse.scm
@@ -409,7 +409,9 @@
(if (null? amt-strings)
formats
(lp (cdr amt-strings)
- (qif-parse:check-number-format (car amt-strings) formats)))))
+ (if (car amt-strings)
+ (qif-parse:check-number-format (car amt-strings) formats)
+ formats)))))
;; list of number-strings and format -> list of numbers eg '("1,00"
;; "2,50" "3,99") 'comma --> '(1 5/2 399/100) this function would
diff --git a/gnucash/import-export/qif-imp/test/test-qif-parse.scm b/gnucash/import-export/qif-imp/test/test-qif-parse.scm
index e4ad5ca91..70f9dace5 100644
--- a/gnucash/import-export/qif-imp/test/test-qif-parse.scm
+++ b/gnucash/import-export/qif-imp/test/test-qif-parse.scm
@@ -248,6 +248,11 @@
(qif-parse:check-number-formats '("10.50" "20.54")
'(decimal comma integer)))
+ (test-equal "qif-parse:check-number-formats 1234.00 #f"
+ '(comma)
+ (qif-parse:check-number-formats '("123,45" #f)
+ '(decimal comma integer)))
+
(test-equal "qif-parse:check-number-formats 1234 4567"
'(decimal comma integer)
(qif-parse:check-number-formats '("1234" "4567")
Summary of changes:
gnucash/import-export/qif-imp/qif-parse.scm | 4 +++-
gnucash/import-export/qif-imp/test/test-qif-parse.scm | 5 +++++
2 files changed, 8 insertions(+), 1 deletion(-)
More information about the gnucash-changes
mailing list