1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

loadparm: Simplify "set_variable"

I usually don't like complicated if/else and in particular the else
piece. But if the alternative is a goto, then else is better I guess :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Thu Jan 29 00:28:55 CET 2015 on sn-devel-104
This commit is contained in:
Volker Lendecke 2015-01-28 16:16:32 +00:00 committed by Garming Sam
parent 62671ad7b2
commit ce909f2ce1

View File

@ -1567,19 +1567,15 @@ bool set_variable(TALLOC_CTX *mem_ctx, struct loadparm_service *service, int par
if (parm_table[parmnum].special) {
ok = parm_table[parmnum].special(lp_ctx, service, pszParmValue,
(char **)parm_ptr);
if (!ok) {
return false;
}
goto mark_non_default;
} else {
ok = set_variable_helper(mem_ctx, parmnum, parm_ptr,
pszParmName, pszParmValue);
}
ok = set_variable_helper(mem_ctx, parmnum, parm_ptr, pszParmName, pszParmValue);
if (!ok) {
return false;
}
mark_non_default:
if (on_globals && (lp_ctx->flags[parmnum] & FLAG_DEFAULT)) {
lp_ctx->flags[parmnum] &= ~FLAG_DEFAULT;
/* we have to also unset FLAG_DEFAULT on aliases */