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-cache.c | |
parent | [PATCH] diff: Fix docs and add -O to diff-helper. (diff) | |
download | tgif-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-cache.c')
-rw-r--r-- | diff-cache.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/diff-cache.c b/diff-cache.c index 8e5f72bf3f..e95fd70da8 100644 --- a/diff-cache.c +++ b/diff-cache.c @@ -191,17 +191,20 @@ int main(int argc, const char **argv) continue; } if (!strncmp(arg, "-B", 2)) { - diff_break_opt = diff_scoreopt_parse(arg); + if ((diff_break_opt = diff_scoreopt_parse(arg)) == -1) + usage(diff_cache_usage); continue; } 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_cache_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_cache_usage); continue; } if (!strcmp(arg, "-z")) { |