On 03/01/14 14:12, Edward Welbourne wrote:
>
> In cf-agent/files_editline.c:
>
> > @@ -1582,14 +1600,14 @@ static int EditLineByColumn(EvalContext *ctx, Rlist **columns, Attributes a,
> >      {
> >          /* internal separator, single char so split again */
> >
> > -        if (strcmp(RlistScalarValue(rp), a.column.column_value) == 0)
> > +        if (strstr(RlistScalarValue(rp), a.column.column_value) || strcmp(RlistScalarValue(rp), a.column.column_value) != 0)
>
> I think this condition is always true. If the column value is equal to 
> the scalar then strstr shall find a match at the start and return 
> non-NULL; otherwise, whether or not strstr does find a match, strcmp() 
> shall return non-zero so the second half of the test passes.
> I imagine this means the condition doesn't say what you meant !
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/cfengine/core/pull/1232/files#r8633780>.
>

Quite right. My incremental changes ended up being cyclically 
redundant.  Removed the whole if.

-- 
Founder and CTO at CFEngine
Author of In Search of Certainty: The Science of our Information 
Infrastructure <http://markburgess.org/certainty.html>