From: Junio C Hamano Date: Thu, 26 Oct 2006 09:05:05 +0000 (-0700) Subject: combine-diff: fix hunk_comment_line logic. X-Git-Tag: v1.4.3.4~18^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7a8ac59f2f1fdac71fdffe53eebdca382118585f;p=git.git 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 --- diff --git a/combine-diff.c b/combine-diff.c index 01a8437f5..76ca65136 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 == '$'); }