Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Sat, 07 Jul 2012 02:48:04 Commit: 47f1042218c27016596908957402242ff64e014d https://github.com/geany/geany-plugins/commit/47f1042218c2701659690895740224...
Log Message: ----------- treebrowser: Fix use of a possibly uninitialized value
Modified Paths: -------------- treebrowser/src/treebrowser.c
Modified: treebrowser/src/treebrowser.c 41 files changed, 21 insertions(+), 20 deletions(-) =================================================================== @@ -682,30 +682,31 @@ enum GtkTreePath *path; gchar *uri_current;
- gtk_tree_model_iter_children(GTK_TREE_MODEL(treestore), &iter, parent); - - do + if (gtk_tree_model_iter_children(GTK_TREE_MODEL(treestore), &iter, parent)) { - if (gtk_tree_model_iter_has_child(GTK_TREE_MODEL(treestore), &iter)) - if (treebrowser_search(uri, &iter)) - return TRUE; + do + { + if (gtk_tree_model_iter_has_child(GTK_TREE_MODEL(treestore), &iter)) + if (treebrowser_search(uri, &iter)) + return TRUE;
- gtk_tree_model_get(GTK_TREE_MODEL(treestore), &iter, TREEBROWSER_COLUMN_URI, &uri_current, -1); + gtk_tree_model_get(GTK_TREE_MODEL(treestore), &iter, TREEBROWSER_COLUMN_URI, &uri_current, -1);
- if (utils_str_equal(uri, uri_current) == TRUE) - { - path = gtk_tree_model_get_path(GTK_TREE_MODEL(treestore), &iter); - gtk_tree_view_expand_to_path(GTK_TREE_VIEW(treeview), path); - gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(treeview), path, TREEBROWSER_COLUMN_ICON, FALSE, 0, 0); - gtk_tree_view_set_cursor(GTK_TREE_VIEW(treeview), path, treeview_column_text, FALSE); - gtk_tree_path_free(path); - g_free(uri_current); - return TRUE; - } - else - g_free(uri_current); + if (utils_str_equal(uri, uri_current) == TRUE) + { + path = gtk_tree_model_get_path(GTK_TREE_MODEL(treestore), &iter); + gtk_tree_view_expand_to_path(GTK_TREE_VIEW(treeview), path); + gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(treeview), path, TREEBROWSER_COLUMN_ICON, FALSE, 0, 0); + gtk_tree_view_set_cursor(GTK_TREE_VIEW(treeview), path, treeview_column_text, FALSE); + gtk_tree_path_free(path); + g_free(uri_current); + return TRUE; + } + else + g_free(uri_current);
- } while(gtk_tree_model_iter_next(GTK_TREE_MODEL(treestore), &iter)); + } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(treestore), &iter)); + }
return FALSE; }
@@ Diff output truncated at 100000 characters. @@
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).