combine-diff: fix hunk_comment_line logic.
[gitweb.git] / combine-diff.c
index 01a8437f5c837f30eb463d19b98774d56f182283..76ca6513699eb0de58fccac14afe7ee97646d69c 100644 (file)
@@ -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 == '$');
 }