Whenever skip_prefix_defval() was called, opt was still equal to
*opt_p.  So we can use skip_prefix_if_present() instead.

Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu>
---
 diff.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/diff.c b/diff.c
index d629cc5..a07fe9d 100644
--- a/diff.c
+++ b/diff.c
@@ -3890,13 +3890,13 @@ static int diff_scoreopt_parse(const char **opt_p)
        *opt_p = opt;
        if (cmd == '-') {
                /* convert the long-form arguments into short-form versions */
-               if ((opt = skip_prefix_defval(opt, "break-rewrites", *opt_p)) 
!= *opt_p) {
+               if ((opt = skip_prefix_if_present(opt, "break-rewrites")) != 
*opt_p) {
                        if (*opt == 0 || *opt++ == '=')
                                cmd = 'B';
-               } else if ((opt = skip_prefix_defval(opt, "find-copies", 
*opt_p)) != *opt_p) {
+               } else if ((opt = skip_prefix_if_present(opt, "find-copies")) 
!= *opt_p) {
                        if (*opt == 0 || *opt++ == '=')
                                cmd = 'C';
-               } else if ((opt = skip_prefix_defval(opt, "find-renames", 
*opt_p)) != *opt_p) {
+               } else if ((opt = skip_prefix_if_present(opt, "find-renames")) 
!= *opt_p) {
                        if (*opt == 0 || *opt++ == '=')
                                cmd = 'M';
                }
-- 
1.8.5.3

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to