diff options
author | Timo Sirainen <cras@irssi.org> | 2002-06-04 21:23:34 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-06-04 21:23:34 +0000 |
commit | 2013e4b004c8d6b3e103ba67e272445aea0e2cfb (patch) | |
tree | 44c960788a6d255ff48faa0705e2bf4b2cbb2848 /src | |
parent | 9092649c74b8c7e760949fcb7b5f0cbea0938ba5 (diff) | |
download | irssi-2013e4b004c8d6b3e103ba67e272445aea0e2cfb.zip |
/UNALIAS didn't work if it had space at the end.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2837 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/core/fe-settings.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/fe-common/core/fe-settings.c b/src/fe-common/core/fe-settings.c index 70bc5cc3..c127f889 100644 --- a/src/fe-common/core/fe-settings.c +++ b/src/fe-common/core/fe-settings.c @@ -240,10 +240,17 @@ static void cmd_alias(const char *data) /* SYNTAX: UNALIAS <alias> */ static void cmd_unalias(const char *data) { + char *alias; + void *free_arg; + g_return_if_fail(data != NULL); - if (*data == '\0') cmd_return_error(CMDERR_NOT_ENOUGH_PARAMS); - alias_remove(data); + if (!cmd_get_params(data, &free_arg, 1, &alias)) + return; + if (*alias == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); + + alias_remove(alias); + cmd_params_free(free_arg); } /* SYNTAX: RELOAD [<file>] */ |