missing check in src_mcconfig_get.c-mc_config_get_groups()_-2

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Vit Rosin 2009-12-11 14:48:01 +02:00 committed by Slava Zanko
parent b6875454b2
commit a7110419a6
5 changed files with 10 additions and 8 deletions

View File

@ -243,12 +243,11 @@ gboolean
mc_fhl_parse_ini_file (mc_fhl_t * fhl)
{
gchar **group_names, **orig_group_names;
gsize ftype_names_size;
mc_fhl_array_free (fhl);
fhl->filters = g_ptr_array_new ();
orig_group_names = group_names = mc_config_get_groups (fhl->config, &ftype_names_size);
orig_group_names = group_names = mc_config_get_groups (fhl->config, NULL);
if (group_names == NULL)
return FALSE;

View File

@ -209,6 +209,9 @@ mc_config_read_file (mc_config_t * mc_config, const gchar * ini_path)
groups = mc_config_get_groups (tmp_config, NULL);
if (groups == NULL)
return FALSE;
for (curr_grp = groups; *curr_grp != NULL; curr_grp++) {
keys = mc_config_get_keys (tmp_config, *curr_grp, NULL);
for (curr_key = keys; *curr_key != NULL; curr_key++) {

View File

@ -46,7 +46,8 @@ mc_config_get_groups (mc_config_t * mc_config, gsize * len)
if (!mc_config)
{
ret = g_try_malloc0 (sizeof (gchar **));
*len=0;
if (len != NULL)
*len=0;
return ret;
}
ret = g_key_file_get_groups (mc_config->handle, len);
@ -67,7 +68,8 @@ mc_config_get_keys (mc_config_t * mc_config, const gchar * group, gsize * len)
if (!mc_config || !group)
{
ret = g_try_malloc0 (sizeof (gchar **));
*len=0;
if (len != NULL)
*len=0;
return ret;
}
ret = g_key_file_get_keys (mc_config->handle, group, len, NULL);

View File

@ -492,7 +492,6 @@ setup__move_panels_config_into_separate_file(const char*profile)
mc_config_t *tmp_cfg;
char **groups, **curr_grp;
const char *need_grp;
gsize groups_count;
if (!exist_file(profile))
return;
@ -501,7 +500,7 @@ setup__move_panels_config_into_separate_file(const char*profile)
if (!tmp_cfg)
return;
curr_grp = groups = mc_config_get_groups (tmp_cfg, &groups_count);
curr_grp = groups = mc_config_get_groups (tmp_cfg, NULL);
if (!groups)
{
mc_config_deinit(tmp_cfg);

View File

@ -250,13 +250,12 @@ mc_skin_color_check_inisection (const gchar * group)
static void
mc_skin_color_check_bw_mode (mc_skin_t * mc_skin)
{
gsize items_count;
gchar **groups, **orig_groups;
if (!mc_args__disable_colors)
return;
orig_groups = groups = mc_config_get_groups (mc_skin->config, &items_count);
orig_groups = groups = mc_config_get_groups (mc_skin->config, NULL);
if (groups == NULL)
return;