diff options
author | Timo Sirainen <cras@irssi.org> | 2001-08-04 01:36:39 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-08-04 01:36:39 +0000 |
commit | dcf1bdb82c47e45d45d5fd889fc6fc94644e27bb (patch) | |
tree | 714d9e3aa8dbe45acf8b84424a4de150d525f340 /src/fe-common/core | |
parent | 80793ace1cc02c1ae1ae882ce9c31ab009091c84 (diff) | |
download | irssi-dcf1bdb82c47e45d45d5fd889fc6fc94644e27bb.zip |
/UNIGNORE - skip spaces at end of line.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1703 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/core')
-rw-r--r-- | src/fe-common/core/fe-ignore.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/fe-common/core/fe-ignore.c b/src/fe-common/core/fe-ignore.c index cb2b40ac..9e24b129 100644 --- a/src/fe-common/core/fe-ignore.c +++ b/src/fe-common/core/fe-ignore.c @@ -169,24 +169,29 @@ static void cmd_unignore(const char *data) { IGNORE_REC *rec; GSList *tmp; + char *mask; + void *free_arg; + + if (!cmd_get_params(data, &free_arg, 1, &mask)) + return; - if (*data == '\0') + if (*mask == '\0') cmd_return_error(CMDERR_NOT_ENOUGH_PARAMS); - if (is_numeric(data, ' ')) { + if (is_numeric(mask, ' ')) { /* with index number */ - tmp = g_slist_nth(ignores, atoi(data)-1); + tmp = g_slist_nth(ignores, atoi(mask)-1); rec = tmp == NULL ? NULL : tmp->data; } else { /* with mask */ const char *chans[2] = { "*", NULL }; if (active_win->active_server != NULL && - active_win->active_server->ischannel(data)) { - chans[0] = data; - data = NULL; + active_win->active_server->ischannel(mask)) { + chans[0] = mask; + mask = NULL; } - rec = ignore_find("*", data, (char **) chans); + rec = ignore_find("*", mask, (char **) chans); } if (rec != NULL) { @@ -194,8 +199,9 @@ static void cmd_unignore(const char *data) ignore_update_rec(rec); } else { printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, - TXT_IGNORE_NOT_FOUND, data); + TXT_IGNORE_NOT_FOUND, mask); } + cmd_params_free(free_arg); } static void sig_ignore_created(IGNORE_REC *rec) |