Skip to content

Commit

Permalink
xdiff: Match GNU diff behaviour when deciding hunk comment worthiness…
Browse files Browse the repository at this point in the history
… of lines

This removes the '#' and '(' tests and adds a '$' test instead although I have
no idea what it is actually good for - but hey, if that's what GNU diff does...

Pasky only went and did as Junio sayeth.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Petr Baudis authored and Junio C Hamano committed Oct 25, 2006
1 parent 6e7d76b commit 70da769
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions xdiff/xemit.c
Expand Up @@ -86,8 +86,7 @@ static void xdl_find_func(xdfile_t *xf, long i, char *buf, long sz, long *ll) {
if (len > 0 &&
(isalpha((unsigned char)*rec) || /* identifier? */
*rec == '_' || /* also identifier? */
*rec == '(' || /* lisp defun? */
*rec == '#')) { /* #define? */
*rec == '$')) { /* mysterious GNU diff's invention */
if (len > sz)
len = sz;
while (0 < len && isspace((unsigned char)rec[len - 1]))
Expand Down

0 comments on commit 70da769

Please sign in to comment.