1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Strip the argument for boolean options. Patch by Svante Kvarnström. Fixes: #769

git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5191 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Alexander Færøy 2010-10-02 21:52:35 +00:00 committed by ahf
parent 5e55d5b974
commit e959bd36d4
2 changed files with 10 additions and 3 deletions

View File

@ -77,3 +77,4 @@ Other patches (grep for "patch" in ChangeLog) by:
Lukas Mai
Ismael Luceno
Thomas Karpiniec
Svante Kvarnström

View File

@ -66,14 +66,20 @@ static void set_print_pattern(const char *pattern)
static void set_boolean(const char *key, const char *value)
{
if (g_ascii_strcasecmp(value, "ON") == 0)
char *stripped_value;
stripped_value = g_strdup(value);
g_strstrip(stripped_value);
if (g_ascii_strcasecmp(stripped_value, "ON") == 0)
settings_set_bool(key, TRUE);
else if (g_ascii_strcasecmp(value, "OFF") == 0)
else if (g_ascii_strcasecmp(stripped_value, "OFF") == 0)
settings_set_bool(key, FALSE);
else if (g_ascii_strcasecmp(value, "TOGGLE") == 0)
else if (g_ascii_strcasecmp(stripped_value, "TOGGLE") == 0)
settings_set_bool(key, !settings_get_bool(key));
else
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, TXT_NOT_TOGGLE);
g_free(stripped_value);
}
static void set_int(const char *key, const char *value)