From 7a8ac59f2f1fdac71fdffe53eebdca382118585f Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 26 Oct 2006 02:05:05 -0700 Subject: [PATCH] combine-diff: fix hunk_comment_line logic. We forgot that the last element of sline[] is a sentinel without the actual line. *BLUSH* Signed-off-by: Junio C Hamano --- combine-diff.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/combine-diff.c b/combine-diff.c index 01a8437f5c..76ca651369 100644 --- a/combine-diff.c +++ b/combine-diff.c @@ -491,7 +491,11 @@ static void show_parent_lno(struct sline *sline, unsigned long l0, unsigned long static int hunk_comment_line(const char *bol) { - int ch = *bol & 0xff; + int ch; + + if (!bol) + return 0; + ch = *bol & 0xff; return (isalpha(ch) || ch == '_' || ch == '$'); } -- 2.11.4.GIT