diff options
author | Junio C Hamano <junkio@cox.net> | 2005-06-03 01:37:54 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-03 11:23:03 -0700 |
commit | 0e3994fa97e9876b571531444b97ae6e63fd744d (patch) | |
tree | f8ff146064f56528bc09efc7eafcc59f61fb344d /diff-tree.c | |
parent | ce24067549a8554b214e723d7aa4bc063c54409e (diff) | |
download | git-0e3994fa97e9876b571531444b97ae6e63fd744d.tar.gz git-0e3994fa97e9876b571531444b97ae6e63fd744d.tar.xz |
[PATCH] diff: Clean up diff_scoreopt_parse().
This cleans up diff_scoreopt_parse() function that is used to
parse the fractional notation -B, -C and -M option takes. The
callers are modified to check for errors and complain. Earlier
they silently ignored malformed input and falled back on the
default.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'diff-tree.c')
-rw-r--r-- | diff-tree.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/diff-tree.c b/diff-tree.c index c3a5617c5..3881c23ca 100644 --- a/diff-tree.c +++ b/diff-tree.c @@ -459,16 +459,19 @@ int main(int argc, const char **argv) } if (!strncmp(arg, "-M", 2)) { detect_rename = DIFF_DETECT_RENAME; - diff_score_opt = diff_scoreopt_parse(arg); + if ((diff_score_opt = diff_scoreopt_parse(arg)) == -1) + usage(diff_tree_usage); continue; } if (!strncmp(arg, "-C", 2)) { detect_rename = DIFF_DETECT_COPY; - diff_score_opt = diff_scoreopt_parse(arg); + if ((diff_score_opt = diff_scoreopt_parse(arg)) == -1) + usage(diff_tree_usage); continue; } if (!strncmp(arg, "-B", 2)) { - diff_break_opt = diff_scoreopt_parse(arg); + if ((diff_break_opt = diff_scoreopt_parse(arg)) == -1) + usage(diff_tree_usage); continue; } if (!strcmp(arg, "-z")) { |