AUDIT: r17663 - gnucash/trunk/src/import-export - Bug #436920: Fix crash on loading OFX data for a commodity that exists without cusip field
Christian Stimming
cstim at cvs.gnucash.org
Sun Oct 26 18:01:59 EDT 2008
Author: cstim
Date: 2008-10-26 18:01:58 -0400 (Sun, 26 Oct 2008)
New Revision: 17663
Trac: http://svn.gnucash.org/trac/changeset/17663
Modified:
gnucash/trunk/src/import-export/import-commodity-matcher.c
Log:
Bug #436920: Fix crash on loading OFX data for a commodity that exists without cusip field
Original patch included also the fix of r16884, which was applied earlier already.
Patch by David Osguthorpe.
BP
Modified: gnucash/trunk/src/import-export/import-commodity-matcher.c
===================================================================
--- gnucash/trunk/src/import-export/import-commodity-matcher.c 2008-10-26 21:53:11 UTC (rev 17662)
+++ gnucash/trunk/src/import-export/import-commodity-matcher.c 2008-10-26 22:01:58 UTC (rev 17663)
@@ -121,6 +121,12 @@
default_mnemonic);
}
+ /* There seems to be a problem here - if the matched commodity does not
+ have a cusip defined (gnc_commodity_get_cusip returns NULL) then
+ it does not get overwritten - which is not consistent with the
+ message - so Im adding it to do this. Looks like this is all
+ that was needed to fix the cash value used as stock units problem
+ for pre-defined commodities which didnt have the cusip defined! */
if (retval != NULL&&
gnc_commodity_get_cusip(retval)!=NULL &&
cusip != NULL &&
@@ -128,6 +134,10 @@
{
gnc_commodity_set_cusip(retval, cusip);
}
+ else if (gnc_commodity_get_cusip(retval)==NULL && cusip != NULL)
+ {
+ gnc_commodity_set_cusip(retval, cusip);
+ }
return retval;
};
/**@}*/
More information about the gnucash-changes
mailing list