aboutsummaryrefslogtreecommitdiff
path: root/builtin-apply.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-06-26 15:35:21 -0700
committerJunio C Hamano <gitster@pobox.com>2008-06-26 18:13:50 -0700
commit8f8841e9c8e6a26153b0cf9417c7540cf65ef09f (patch)
treeae7ad9eae079372793dd39b7544105f64aba95f7 /builtin-apply.c
parent5ff10dd602f5926f0f5a73ae7de5866713428aa7 (diff)
downloadgit-8f8841e9c8e6a26153b0cf9417c7540cf65ef09f.tar.gz
git-8f8841e9c8e6a26153b0cf9417c7540cf65ef09f.tar.xz
check_and_emit_line(): rename and refactor
The function name was too bland and not explicit enough as to what it is checking. Split it into two, and call the one that checks if there is a whitespace breakage "ws_check()", and call the other one that checks and emits the line after color coding "ws_check_emit()". Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-apply.c')
-rw-r--r--builtin-apply.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/builtin-apply.c b/builtin-apply.c
index c49788931..92f00471b 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -979,8 +979,7 @@ static int find_header(char *line, unsigned long size, int *hdrsize, struct patc
static void check_whitespace(const char *line, int len, unsigned ws_rule)
{
char *err;
- unsigned result = check_and_emit_line(line + 1, len - 1, ws_rule,
- NULL, NULL, NULL, NULL);
+ unsigned result = ws_check(line + 1, len - 1, ws_rule);
if (!result)
return;
@@ -991,7 +990,7 @@ static void check_whitespace(const char *line, int len, unsigned ws_rule)
else {
err = whitespace_error_string(result);
fprintf(stderr, "%s:%d: %s.\n%.*s\n",
- patch_input_file, linenr, err, len - 2, line + 1);
+ patch_input_file, linenr, err, len - 2, line + 1);
free(err);
}
}