diff options
Diffstat (limited to 'account.c')
-rw-r--r-- | account.c | 32 |
1 files changed, 18 insertions, 14 deletions
@@ -78,22 +78,10 @@ char *set_eval_account( set_t *set, char *value ) if( set->flags & ACC_SET_OFFLINE_ONLY && acc->ic ) return NULL; - if( strcmp( set->key, "username" ) == 0 ) - { - g_free( acc->user ); - acc->user = g_strdup( value ); - return value; - } - else if( strcmp( set->key, "password" ) == 0 ) - { - g_free( acc->pass ); - acc->pass = g_strdup( value ); - return NULL; /* password shouldn't be visible in plaintext! */ - } - else if( strcmp( set->key, "server" ) == 0 ) + if( strcmp( set->key, "server" ) == 0 ) { g_free( acc->server ); - if( *value ) + if( value && *value ) { acc->server = g_strdup( value ); return value; @@ -104,6 +92,22 @@ char *set_eval_account( set_t *set, char *value ) return g_strdup( set->def ); } } + else if( value == NULL ) + { + /* Noop, the other three can't be NULL. */ + } + else if( strcmp( set->key, "username" ) == 0 ) + { + g_free( acc->user ); + acc->user = g_strdup( value ); + return value; + } + else if( strcmp( set->key, "password" ) == 0 ) + { + g_free( acc->pass ); + acc->pass = g_strdup( value ); + return NULL; /* password shouldn't be visible in plaintext! */ + } else if( strcmp( set->key, "auto_connect" ) == 0 ) { if( !is_bool( value ) ) |