merge-recursive: fix parsing of "diff-algorithm" option
commit6562928ae9ea46a3f2a7bd5a3dd500a7c149cc64
authorJohn Keeping <john@keeping.me.uk>
Thu, 26 Sep 2013 20:02:48 +0000 (26 21:02 +0100)
committerJonathan Nieder <jrnieder@gmail.com>
Thu, 26 Sep 2013 20:52:16 +0000 (26 13:52 -0700)
treee608b1930401d15dfd4c3d041c78a70c1e639453
parent0895c6d4c09045a3faeb7b652a844fc81c774631
merge-recursive: fix parsing of "diff-algorithm" option

The "diff-algorithm" option to the recursive merge strategy takes the
name of the algorithm as an option, but it uses strcmp on the option
string to check if it starts with "diff-algorithm=", meaning that this
options cannot actually be used.

Fix this by switching to prefixcmp.  At the same time, clarify the
following line by using strlen instead of a hard-coded length, which
also makes it consistent with nearby code.

Reported-by: Luke Noel-Storr <luke.noel-storr@integrate.co.uk>
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
merge-recursive.c