From 7aeb5ac87c6105bd8fcc9b1fd12e37ba1550f587 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Mon, 19 Jun 2017 14:38:43 -0500 Subject: Import Upstream version 0.4.2.2 --- arch/linux/common/modules.h | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'arch/linux/common/modules.h') diff --git a/arch/linux/common/modules.h b/arch/linux/common/modules.h index 9b895ee8..6fbe13bd 100644 --- a/arch/linux/common/modules.h +++ b/arch/linux/common/modules.h @@ -26,12 +26,7 @@ static gboolean remove_module_devices(gpointer key, gpointer value, gpointer data) { - if (!strncmp((gchar *) key, "MOD", 3)) { - g_free((gchar *) key); - g_free((GtkTreeIter *) value); - return TRUE; - } - return FALSE; + return g_str_has_prefix(key, "MOD"); } static void @@ -42,9 +37,9 @@ scan_modules_do(void) if (module_list) { g_free(module_list); - module_list = NULL; } - + + module_list = NULL; g_hash_table_foreach_remove(moreinfo, remove_module_devices, NULL); lsmod = popen("/sbin/lsmod", "r"); @@ -103,8 +98,8 @@ scan_modules_do(void) } /* append this module to the list of modules */ - module_list = g_strdup_printf("%s$%s$%s=%s\n", - module_list ? module_list : "", + module_list = h_strdup_cprintf("$%s$%s=%s\n", + module_list, hashkey, modname, description ? description : ""); @@ -134,7 +129,7 @@ scan_modules_do(void) if (deps && strlen(deps)) { gchar **tmp = g_strsplit(deps, ",", 0); - strmodule = g_strconcat(strmodule, + strmodule = h_strconcat(strmodule, "\n[Dependencies]\n", g_strjoinv("=\n", tmp), "=\n", NULL); -- cgit v1.2.3