From 28c2cae07f03c0b5f86d894a6c692136a28b37f7 Mon Sep 17 00:00:00 2001
From: Vit Rosin <vit_r@list.ru>
Date: Thu, 3 Dec 2009 14:58:31 +0000
Subject: [PATCH] missing check in src_mcconfig_get.c-mc_config_get_groups()_-2
---
src/filehighlight/ini-file-read.c | 3 +--
src/mcconfig/common.c | 2 ++
src/mcconfig/get.c | 3 +--
src/setup.c | 3 +--
src/skin/colors.c | 3 +--
5 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/filehighlight/ini-file-read.c b/src/filehighlight/ini-file-read.c
index b2f4901..4aee22a 100644
a
|
b
|
gboolean |
243 | 243 | mc_fhl_parse_ini_file (mc_fhl_t * fhl) |
244 | 244 | { |
245 | 245 | gchar **group_names, **orig_group_names; |
246 | | gsize ftype_names_size; |
247 | 246 | |
248 | 247 | mc_fhl_array_free (fhl); |
249 | 248 | fhl->filters = g_ptr_array_new (); |
250 | 249 | |
251 | | orig_group_names = group_names = mc_config_get_groups (fhl->config, &ftype_names_size); |
| 250 | orig_group_names = group_names = mc_config_get_groups (fhl->config, NULL); |
252 | 251 | |
253 | 252 | if (group_names == NULL) |
254 | 253 | return FALSE; |
diff --git a/src/mcconfig/common.c b/src/mcconfig/common.c
index b0999ba..d7233f9 100644
a
|
b
|
mc_config_read_file (mc_config_t * mc_config, const gchar * ini_path) |
208 | 208 | return FALSE; |
209 | 209 | |
210 | 210 | groups = mc_config_get_groups (tmp_config, NULL); |
| 211 | if (!groups) |
| 212 | return FALSE; |
211 | 213 | |
212 | 214 | for (curr_grp = groups; *curr_grp != NULL; curr_grp++) { |
213 | 215 | keys = mc_config_get_keys (tmp_config, *curr_grp, NULL); |
diff --git a/src/mcconfig/get.c b/src/mcconfig/get.c
index 693ebf4..a7bdf34 100644
a
|
b
|
mc_config_get_groups (mc_config_t * mc_config, gsize * len) |
45 | 45 | |
46 | 46 | if (!mc_config) |
47 | 47 | { |
48 | | ret = g_try_malloc0 (sizeof (gchar **)); |
49 | 48 | if (len) |
50 | 49 | *len = 0; |
51 | | return ret; |
| 50 | return NULL; |
52 | 51 | } |
53 | 52 | ret = g_key_file_get_groups (mc_config->handle, len); |
54 | 53 | if (ret == NULL) |
diff --git a/src/setup.c b/src/setup.c
index 3f7adca..7b7cee1 100644
a
|
b
|
setup__move_panels_config_into_separate_file(const char*profile) |
492 | 492 | mc_config_t *tmp_cfg; |
493 | 493 | char **groups, **curr_grp; |
494 | 494 | const char *need_grp; |
495 | | gsize groups_count; |
496 | 495 | |
497 | 496 | if (!exist_file(profile)) |
498 | 497 | return; |
… |
… |
setup__move_panels_config_into_separate_file(const char*profile) |
501 | 500 | if (!tmp_cfg) |
502 | 501 | return; |
503 | 502 | |
504 | | curr_grp = groups = mc_config_get_groups (tmp_cfg, &groups_count); |
| 503 | curr_grp = groups = mc_config_get_groups (tmp_cfg, NULL); |
505 | 504 | if (!groups) |
506 | 505 | { |
507 | 506 | mc_config_deinit(tmp_cfg); |
diff --git a/src/skin/colors.c b/src/skin/colors.c
index e4dd66b..d595bb5 100644
a
|
b
|
mc_skin_color_check_inisection (const gchar * group) |
250 | 250 | static void |
251 | 251 | mc_skin_color_check_bw_mode (mc_skin_t * mc_skin) |
252 | 252 | { |
253 | | gsize items_count; |
254 | 253 | gchar **groups, **orig_groups; |
255 | 254 | |
256 | 255 | if (!mc_args__disable_colors) |
257 | 256 | return; |
258 | 257 | |
259 | | orig_groups = groups = mc_config_get_groups (mc_skin->config, &items_count); |
| 258 | orig_groups = groups = mc_config_get_groups (mc_skin->config, NULL); |
260 | 259 | |
261 | 260 | if (groups == NULL) |
262 | 261 | return; |