From 6ee51a914b26fec1f7036af758be514bbfed9778 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 19 Aug 2012 15:07:48 +0100 Subject: Allow "set -del password". #984 --- protocols/account.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'protocols/account.c') diff --git a/protocols/account.c b/protocols/account.c index 12831531..0eb16b59 100644 --- a/protocols/account.c +++ b/protocols/account.c @@ -153,18 +153,14 @@ char *set_eval_account( set_t *set, char *value ) } else if( strcmp( set->key, "password" ) == 0 ) { - if( value ) - { - g_free( acc->pass ); - acc->pass = g_strdup( value ); - return NULL; /* password shouldn't be visible in plaintext! */ - } - else - { - /* NULL can (should) be stored in the set_t - variable, but is otherwise not correct. */ - return SET_INVALID; - } + /* set -del should be allowed now, but I don't want to have any + NULL pointers to have to deal with. */ + if( !value ) + value = ""; + + g_free( acc->pass ); + acc->pass = g_strdup( value ); + return NULL; /* password shouldn't be visible in plaintext! */ } else if( strcmp( set->key, "tag" ) == 0 ) { -- cgit v1.2.3