- Timestamp:
- 2008-08-24T18:01:05Z (16 years ago)
- Branches:
- master
- Children:
- f3579fd
- Parents:
- 934dddf3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
set.c
r934dddf3 r7125cb3 25 25 #define BITLBEE_CORE 26 26 #include "bitlbee.h" 27 28 /* Used to use NULL for this, but NULL is actually a "valid" value. */ 29 char *SET_INVALID = "nee"; 27 30 28 31 set_t *set_add( set_t **head, char *key, char *def, set_eval eval, void *data ) … … 114 117 115 118 if( !s ) 119 /* 120 Used to do this, but it never really made sense. 116 121 s = set_add( head, key, NULL, NULL, NULL ); 117 118 if( s->eval && !( nv = s->eval( s, value ) ) ) 122 */ 123 return 0; 124 125 if( value == NULL && ( s->flags & SET_NULL_OK ) == 0 ) 126 return 0; 127 128 /* Call the evaluator. For invalid values, evaluators should now 129 return SET_INVALID, but previously this was NULL. Try to handle 130 that too if NULL is not an allowed value for this setting. */ 131 if( s->eval && ( ( nv = s->eval( s, value ) ) == SET_INVALID || 132 ( ( s->flags & SET_NULL_OK ) == 0 && nv == NULL ) ) ) 119 133 return 0; 120 134 … … 187 201 for( ; *s; s ++ ) 188 202 if( !isdigit( *s ) ) 189 return NULL;203 return SET_INVALID; 190 204 191 205 return value; … … 194 208 char *set_eval_bool( set_t *set, char *value ) 195 209 { 196 return is_bool( value ) ? value : NULL;210 return is_bool( value ) ? value : SET_INVALID; 197 211 } 198 212 … … 226 240 irc->channel, "-oo", irc->nick, irc->mynick ); 227 241 else 228 return NULL;242 return SET_INVALID; 229 243 230 244 return value;
Note: See TracChangeset
for help on using the changeset viewer.