gnucash master: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Sun Jul 5 14:28:40 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/43749a94 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/79fdcf2f (commit)
	 via  https://github.com/Gnucash/gnucash/commit/4afe4f95 (commit)
	from  https://github.com/Gnucash/gnucash/commit/5bf009a9 (commit)



commit 43749a94956275d56a695e6cbb227c3bc1784a99
Merge: 5bf009a9b 79fdcf2f7
Author: John Ralls <jralls at ceridwen.us>
Date:   Sun Jul 5 11:21:34 2020 -0700

    Merge Jean Laroche's 'bug_797825_ofx_invest_crash' onto master.


commit 79fdcf2f7170e40c18e5e502ee286866bf4ee2e9
Author: jean <you at example.com>
Date:   Wed Jul 1 12:33:54 2020 -0700

    Remove created commodities code as it does nothing

diff --git a/gnucash/import-export/ofx/gnc-ofx-import.c b/gnucash/import-export/ofx/gnc-ofx-import.c
index aa2be5106..0e8e1816c 100644
--- a/gnucash/import-export/ofx/gnc-ofx-import.c
+++ b/gnucash/import-export/ofx/gnc-ofx-import.c
@@ -75,12 +75,9 @@ typedef struct _ofx_info
     gint num_trans_processed;               // Number of transactions processed
     struct OfxStatementData* statement;     // Statement, if any
     gboolean run_reconcile;                 // If TRUE the reconcile window is opened after matching.
-    GList *created_commodites;
     GSList* file_list;                      // List of OFX files to import
 } ofx_info ;
 
-GList *ofx_created_commodites = NULL;
-
 /*
 int ofx_proc_status_cb(struct OfxStatusData data)
 {
@@ -290,8 +287,6 @@ int ofx_proc_security_cb(const struct OfxSecurityData data, void * security_user
             /* Remember the commodity */
             gnc_commodity_table_insert(gnc_get_current_commodities(), commodity);
 
-            /* Remember this new commodity for us as well */
-            info->created_commodites = g_list_prepend(info->created_commodites, commodity);
 	    g_free (commodity_namespace);
 
         }
@@ -1074,18 +1069,6 @@ gnc_ofx_process_next_file (GtkDialog *dialog, gpointer user_data)
     {
         // Final cleanup.
         g_free (info);
-        if (ofx_created_commodites)
-        {
-            /* FIXME: Present some result window about the newly created
-             * commodities */
-            g_warning ("Created %d new commodities during import", g_list_length(ofx_created_commodites));
-            g_list_free (ofx_created_commodites);
-            ofx_created_commodites = NULL;
-        }
-        else
-        {
-            //g_warning("No new commodities created");
-        }
     }
 }
 
@@ -1255,7 +1238,6 @@ void gnc_file_ofx_import (GtkWindow *parent)
         info->last_investment_account = NULL;
         info->last_import_account = NULL;
         info->last_income_account = NULL;
-        info->created_commodites = NULL;
         info->parent = parent;
         info->run_reconcile = FALSE;
         info->file_list = selected_filenames;

commit 4afe4f95dd69cf2713267810c65942ff2a591ed6
Author: jean <you at example.com>
Date:   Sun Jun 28 23:25:08 2020 -0700

    Bug 797825 - OFX import crashes on import of investment transaction
    
    The crash is caused by an uninitialized pointer in ofx_info.
    This fixed it.

diff --git a/gnucash/import-export/ofx/gnc-ofx-import.c b/gnucash/import-export/ofx/gnc-ofx-import.c
index 88456acf9..aa2be5106 100644
--- a/gnucash/import-export/ofx/gnc-ofx-import.c
+++ b/gnucash/import-export/ofx/gnc-ofx-import.c
@@ -1252,6 +1252,10 @@ void gnc_file_ofx_import (GtkWindow *parent)
         info = g_new(ofx_info,1);
         info->num_trans_processed = 0;
         info->statement = NULL;
+        info->last_investment_account = NULL;
+        info->last_import_account = NULL;
+        info->last_income_account = NULL;
+        info->created_commodites = NULL;
         info->parent = parent;
         info->run_reconcile = FALSE;
         info->file_list = selected_filenames;



Summary of changes:
 gnucash/import-export/ofx/gnc-ofx-import.c | 20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)



More information about the gnucash-changes mailing list