X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=diff-helper.c;h=c9e287f652b9cba95dd6e181066c1efa1a73307c;hb=ddafa7e93325d45cd4bd950dd8e89ff3188d0250;hp=5ad2273bf063fb431f095de2d58ebdfb78814d3b;hpb=2bc2564145835996734d6ed5d1880f85b17233d6;p=git.git diff --git a/diff-helper.c b/diff-helper.c index 5ad2273b..c9e287f6 100644 --- a/diff-helper.c +++ b/diff-helper.c @@ -80,17 +80,16 @@ int main(int ac, const char **av) { if (!strchr("MCRNDU", status)) break; two_paths = score = 0; - if (status == 'R' || status == 'C') { + if (status == 'R' || status == 'C') two_paths = 1; - sscanf(cp, "%d", &score); - if (line_termination) { - cp = strchr(cp, - inter_name_termination); - if (!cp) - break; - } - } + /* pick up score if exists */ + if (sscanf(cp, "%d", &score) != 1) + score = 0; + cp = strchr(cp, + inter_name_termination); + if (!cp) + break; if (*cp++ != inter_name_termination) break;