Print new values only once successfully set

This commit is contained in:
Pierre Pronchery 2015-10-10 00:19:09 +02:00
parent 58e064de97
commit 089ce1cc3d

View File

@ -97,9 +97,9 @@ static int _configctl_do(Config * config, int verbose, char const * section,
} }
else if(value != NULL) else if(value != NULL)
{ {
_configctl_print(verbose, section, key, value);
if(config_set(config, section, key, value) != 0) if(config_set(config, section, key, value) != 0)
return -_configctl_error(PROGNAME, 1); return -_configctl_error(PROGNAME, 1);
_configctl_print(verbose, section, key, value);
} }
else else
return -_configctl_error(PROGNAME, 1); return -_configctl_error(PROGNAME, 1);