1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 21:36:37 +02:00

Values yes/no accepted (as on/off) for config boolean values (task #5454)

This commit is contained in:
Sebastien Helleu
2006-08-26 08:38:04 +00:00
parent 00fbd7ad56
commit bb021e567a
4 changed files with 12 additions and 6 deletions
+2 -1
View File
@@ -1,10 +1,11 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2006-08-25
ChangeLog - 2006-08-26
Version 0.2.1 (under dev!):
* values yes/no accepted (as on/off) for config boolean values (task #5454)
* added server default notify level (set by /buffer notify on server buffer)
(task #5634)
* fixed crashs with /buffer and /charset commands when not connected to any
+4 -2
View File
@@ -1348,9 +1348,11 @@ config_option_set_value (t_config_option *option, char *value)
switch (option->option_type)
{
case OPTION_TYPE_BOOLEAN:
if (ascii_strcasecmp (value, "on") == 0)
if ((ascii_strcasecmp (value, "on") == 0)
|| (ascii_strcasecmp (value, "yes") == 0))
*(option->ptr_int) = BOOL_TRUE;
else if (ascii_strcasecmp (value, "off") == 0)
else if ((ascii_strcasecmp (value, "off") == 0)
|| (ascii_strcasecmp (value, "no") == 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-08-25
ChangeLog - 2006-08-26
Version 0.2.1 (under dev!):
* values yes/no accepted (as on/off) for config boolean values (task #5454)
* added server default notify level (set by /buffer notify on server buffer)
(task #5634)
* fixed crashs with /buffer and /charset commands when not connected to any
+4 -2
View File
@@ -1348,9 +1348,11 @@ config_option_set_value (t_config_option *option, char *value)
switch (option->option_type)
{
case OPTION_TYPE_BOOLEAN:
if (ascii_strcasecmp (value, "on") == 0)
if ((ascii_strcasecmp (value, "on") == 0)
|| (ascii_strcasecmp (value, "yes") == 0))
*(option->ptr_int) = BOOL_TRUE;
else if (ascii_strcasecmp (value, "off") == 0)
else if ((ascii_strcasecmp (value, "off") == 0)
|| (ascii_strcasecmp (value, "no") == 0))
*(option->ptr_int) = BOOL_FALSE;
else
return -1;