[PATCH] Improve lib/param handling and remove another unused script

Stefan (metze) Metzmacher metze at samba.org
Wed Jan 29 05:42:34 MST 2014


Am 29.01.2014 13:34, schrieb Michael Adam:
> @@ -1417,10 +1417,20 @@ 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 */
> -		for (i=parmnum-1;i>=0 && parm_table[i].offset == parm_table[parmnum].offset;i--) {
> +		for (i = parmnum-1;
> +		     i >= 0 &&
> +		     parm_table[i].p_class == parm_table[parmnum].p_class &&
> +		     parm_table[i].offset == parm_table[parmnum].offset;
> +		     i--)
> +		{
>  			lp_ctx->flags[i] &= ~FLAG_DEFAULT;
>  		}
> -		for (i=parmnum+1;i<NUMPARAMETERS && parm_table[i].offset == parm_table[parmnum].offset;i++) {
> +		for (i = parmnum+1;
> +		     i < NUMPARAMETERS &&
> +		     parm_table[i].p_class == parm_table[parmnum].p_class &&
> +		     parm_table[i].offset == parm_table[parmnum].offset;
> +		     i++)
> +		{
>  			lp_ctx->flags[i] &= ~FLAG_DEFAULT;
>  		}
>  	}

What about adding a macro like

PARM_TABLE_EQUAL(a, b) ((a->p_class == b->p_class) && (a->offset ==
b->offset))

?
metze


More information about the samba-technical mailing list