[patch] Fixes for commodity debug logging

Daniel Harding dharding at quikmail.org
Wed Nov 21 11:41:33 EST 2007


When adding gnc.commodity=debug to log.conf, a few problems result, 
which this patch attempts to fix.

A few functions (gnc_quote_source_get_type, gnc_quote_source_get_index, 
gnc_quote_source_get_supported) called the ENTER macro when starting but 
called the DEBUG macro when returning.  Because these ENTER calls had no 
matching LEAVE, the indentation in the log file would become messed up.  
This patch fixes that problem by changing those DEBUG macros to LEAVE 
macros.

More seriously, gnucash would crash when editing a commodity whose quote 
source timezone is set to local time.  In that case 
gnc_commodity_set_quote_tz  is called with a NULL tz parameter.  
However, the ENTER macro would always attempt to dereference tz to print 
it, resulting a crash.  This patch fixes that problem changing the macro 
to use the string "(null)" in the case that tz is NULL.

I have not yet filed bugs on these issues.  If that would be helpful I 
can do so.

Daniel Harding
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: commodity_logging.diff
Url: http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20071121/564dc936/attachment.pl 


More information about the gnucash-devel mailing list