Changeset 7125cb3 for protocols/nogaim.c


Ignore:
Timestamp:
2008-08-24T18:01:05Z (16 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
f3579fd
Parents:
934dddf3
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.c

    r934dddf3 r7125cb3  
    928928        int st;
    929929       
    930         if( ( g_strcasecmp( value, "true" ) == 0 ) || ( g_strcasecmp( value, "yes" ) == 0 ) || ( g_strcasecmp( value, "on" ) == 0 ) )
    931                 st = 1;
    932         else if( ( g_strcasecmp( value, "false" ) == 0 ) || ( g_strcasecmp( value, "no" ) == 0 ) || ( g_strcasecmp( value, "off" ) == 0 ) )
    933                 st = 0;
    934         else if( sscanf( value, "%d", &st ) != 1 )
    935                 return( NULL );
    936        
    937         st = st != 0;
     930        if( !is_bool( value ) )
     931                return SET_INVALID;
     932       
     933        st = bool2int( value );
    938934       
    939935        /* Horror.... */
     
    979975        }
    980976       
    981         return( set_eval_bool( set, value ) );
     977        return value;
    982978}
    983979
Note: See TracChangeset for help on using the changeset viewer.