aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/nogaim.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2008-08-24 19:01:05 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2008-08-24 19:01:05 +0100
commit7125cb3775a0e384c0f2fc08fd56df9582199502 (patch)
tree7972791c53152194e4c5053801abd071c17128ca /protocols/nogaim.c
parent934dddf3614eae2b4f305f42583b070bdbd5bc86 (diff)
Added SET_INVALID, which set evaluators should now return instead of NULL
when the given value is not accepted. This to allow certain variables actually be set to NULL (server, for example). This should fully close #444.
Diffstat (limited to 'protocols/nogaim.c')
-rw-r--r--protocols/nogaim.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/protocols/nogaim.c b/protocols/nogaim.c
index b6f8d6e4..6a267adf 100644
--- a/protocols/nogaim.c
+++ b/protocols/nogaim.c
@@ -927,14 +927,10 @@ char *set_eval_away_devoice( set_t *set, char *value )
irc_t *irc = set->data;
int st;
- if( ( g_strcasecmp( value, "true" ) == 0 ) || ( g_strcasecmp( value, "yes" ) == 0 ) || ( g_strcasecmp( value, "on" ) == 0 ) )
- st = 1;
- else if( ( g_strcasecmp( value, "false" ) == 0 ) || ( g_strcasecmp( value, "no" ) == 0 ) || ( g_strcasecmp( value, "off" ) == 0 ) )
- st = 0;
- else if( sscanf( value, "%d", &st ) != 1 )
- return( NULL );
+ if( !is_bool( value ) )
+ return SET_INVALID;
- st = st != 0;
+ st = bool2int( value );
/* Horror.... */
@@ -978,7 +974,7 @@ char *set_eval_away_devoice( set_t *set, char *value )
irc->channel, pm, v, list );
}
- return( set_eval_bool( set, value ) );
+ return value;
}