1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 05:46:38 +02:00

Added more values for config boolean values: y/true/t/1 and n/false/f/0 (patch from Stalwart)

This commit is contained in:
Sebastien Helleu
2006-10-12 12:30:11 +00:00
parent 14751f721d
commit 8c29d36461
4 changed files with 24 additions and 6 deletions
+2 -1
View File
@@ -1,10 +1,11 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2006-10-09
ChangeLog - 2006-10-12
Version 0.2.2 (under dev!):
* added more values for config boolean values: y/true/t/1 and n/false/f/0
* fixed bug with /alias and arguments (like $1), now text after
argument(s) is used (bug #17944)
* fixed minor display bug with special chars on some arch like PPC
+10 -2
View File
@@ -1349,10 +1349,18 @@ config_option_set_value (t_config_option *option, char *value)
{
case OPTION_TYPE_BOOLEAN:
if ((ascii_strcasecmp (value, "on") == 0)
|| (ascii_strcasecmp (value, "yes") == 0))
|| (ascii_strcasecmp (value, "yes") == 0)
|| (ascii_strcasecmp (value, "y") == 0)
|| (ascii_strcasecmp (value, "true") == 0)
|| (ascii_strcasecmp (value, "t") == 0)
|| (ascii_strcasecmp (value, "1") == 0))
*(option->ptr_int) = BOOL_TRUE;
else if ((ascii_strcasecmp (value, "off") == 0)
|| (ascii_strcasecmp (value, "no") == 0))
|| (ascii_strcasecmp (value, "no") == 0)
|| (ascii_strcasecmp (value, "n") == 0)
|| (ascii_strcasecmp (value, "false") == 0)
|| (ascii_strcasecmp (value, "f") == 0)
|| (ascii_strcasecmp (value, "0") == 0))
*(option->ptr_int) = BOOL_FALSE;
else
return -1;
+2 -1
View File
@@ -1,10 +1,11 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2006-10-09
ChangeLog - 2006-10-12
Version 0.2.2 (under dev!):
* added more values for config boolean values: y/true/t/1 and n/false/f/0
* fixed bug with /alias and arguments (like $1), now text after
argument(s) is used (bug #17944)
* fixed minor display bug with special chars on some arch like PPC
+10 -2
View File
@@ -1349,10 +1349,18 @@ config_option_set_value (t_config_option *option, char *value)
{
case OPTION_TYPE_BOOLEAN:
if ((ascii_strcasecmp (value, "on") == 0)
|| (ascii_strcasecmp (value, "yes") == 0))
|| (ascii_strcasecmp (value, "yes") == 0)
|| (ascii_strcasecmp (value, "y") == 0)
|| (ascii_strcasecmp (value, "true") == 0)
|| (ascii_strcasecmp (value, "t") == 0)
|| (ascii_strcasecmp (value, "1") == 0))
*(option->ptr_int) = BOOL_TRUE;
else if ((ascii_strcasecmp (value, "off") == 0)
|| (ascii_strcasecmp (value, "no") == 0))
|| (ascii_strcasecmp (value, "no") == 0)
|| (ascii_strcasecmp (value, "n") == 0)
|| (ascii_strcasecmp (value, "false") == 0)
|| (ascii_strcasecmp (value, "f") == 0)
|| (ascii_strcasecmp (value, "0") == 0))
*(option->ptr_int) = BOOL_FALSE;
else
return -1;