Wrong Import date format selection crashes Gnucash

Geert Janssens geert.gnucash at kobaltwit.be
Tue Jan 10 10:11:29 EST 2017


Op maandag 12 december 2016 12:13:13 CET schreef Derek Atkins:
> Hi,
> 
> John Ralls <jralls at ceridwen.us> writes:
> >> On Dec 11, 2016, at 11:32 AM, Robert Fewell <14ubobit at gmail.com> wrote:
> >> 
> >> #15 0x00007ffff6c2431f in gnc_dmy2timespec_neutral (day=day at entry=2016,
> >> month=month at entry=12, year=year at entry=2001)
> > 
> > The problem seems pretty obvious...
> > 
> >>    at gnc-date.cpp:1251
> >> 
> >> ---Type <return> to continue, or q <return> to quit---
> >> #16 0x00007fffe038564d in parse_date_with_year (format=<optimized out>,
> >> date_str=0x11f1220 "2016/12/01") at gnc-csv-model.c:212
> >> #17 parse_date (date_str=0x11f1220 "2016/12/01", format=1) at
> >> gnc-csv-model.c:304
> > 
> > Here you're telling parse_date_with_year to use "d-m-y" with a y-m-d
> > format, and so passing an invalid day to gnc_dmy2rimespec_neutral.
> 
> This begs the question -- why is the UI allowing an invalid choice for
> the date format?
> 
> The QIF importer tests the dates to attempt to determine the format and
> presents the user with possible choices in the event of any ambiguity.
> Has that functionality still not been ported to the C code before added
> the format selector?
> 
I don't think so this has ever been ported. I will keep this in mind for later 
improvements to the import code.

At some point I hope to extend much of my work on the csv importer to the 
other importers as much of my code is fairly generic and should be mostly 
reusable for the other importers as well.

Geert


More information about the gnucash-devel mailing list