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 <junkio@cox.net>
Junio C Hamano committed
Oct 26, 2006 at 02:05 UTC
7a8ac59f2f1fdac71fdffe53eebdca382118585f
1 file changed
+5
-1
combine-diff.c
+5
-1
@@ -491,7 +491,11 @@ static void show_parent_lno(struct sline *sline, unsigned long l0, unsigned long
491
492
static int hunk_comment_line(const char *bol)
493
{
494
- int ch = *bol & 0xff;
494
+ int ch;
495
+
496
+ if (!bol)
497
+ return 0;
498
+ ch = *bol & 0xff;
499
return (isalpha(ch) || ch == '_' || ch == '$');
500
}
501