--- src/import-export/import-commodity-matcher.c.orig	Sun Feb 18 20:40:15 2007
+++ src/import-export/import-commodity-matcher.c	Sun May  6 08:16:08 2007
@@ -121,10 +121,21 @@
 						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!!
+  // note also the bug fix of retval not tmp_commodity
   if (retval != NULL&&
-      gnc_commodity_get_cusip(tmp_commodity)!=NULL &&
+      gnc_commodity_get_cusip(retval)!=NULL &&
       cusip != NULL &&
       (strncmp(gnc_commodity_get_cusip(retval),cusip,strlen(cusip))!=0))
+    {
+      gnc_commodity_set_cusip(retval, cusip);
+    }
+  else if (gnc_commodity_get_cusip(retval)==NULL && cusip != NULL)
     {
       gnc_commodity_set_cusip(retval, cusip);
     }
