diff options
author | Timo Sirainen <cras@irssi.org> | 2000-05-09 13:14:07 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-05-09 13:14:07 +0000 |
commit | e33da25e8a31d9871e3378a598565d186b57c0a7 (patch) | |
tree | 63c00ad020c2162e402e56d10d513e94c547db45 /src | |
parent | ef6b0a1ad967c74ab957bbfa3f167e95fcf6c7a7 (diff) | |
download | irssi-e33da25e8a31d9871e3378a598565d186b57c0a7.zip |
/dehilight fixes
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@203 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/core/hilight-text.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/fe-common/core/hilight-text.c b/src/fe-common/core/hilight-text.c index 61156e01..41467e7c 100644 --- a/src/fe-common/core/hilight-text.c +++ b/src/fe-common/core/hilight-text.c @@ -41,6 +41,8 @@ static void hilight_add_config(HILIGHT_REC *rec) { CONFIG_NODE *node; + g_return_if_fail(rec != NULL); + node = iconfig_node_traverse("(hilights", TRUE); node = config_node_section(node, NULL, NODE_TYPE_BLOCK); @@ -61,12 +63,16 @@ static void hilight_remove_config(HILIGHT_REC *rec) { CONFIG_NODE *node; + g_return_if_fail(rec != NULL); + node = iconfig_node_traverse("hilights", FALSE); if (node != NULL) config_node_list_remove(node, g_slist_index(hilights, rec)); } static void hilight_destroy(HILIGHT_REC *rec) { + g_return_if_fail(rec != NULL); + g_free(rec->text); g_free_not_null(rec->color); g_free(rec); @@ -81,6 +87,8 @@ static void hilights_destroy_all(void) static void hilight_remove(HILIGHT_REC *rec) { + g_return_if_fail(rec != NULL); + hilight_remove_config(rec); hilights = g_slist_remove(hilights, rec); hilight_destroy(rec); @@ -324,9 +332,10 @@ static void cmd_dehilight(const char *data) if (rec == NULL) printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_HILIGHT_NOT_FOUND, data); - else + else { printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_HILIGHT_REMOVED, rec->text); - hilight_remove(rec); + hilight_remove(rec); + } } void hilight_text_init(void) |