Browse Source

xdiff: Match GNU diff behaviour when deciding hunk comment worthiness 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>
maint
Petr Baudis 18 years ago committed by Junio C Hamano
parent
commit
70da769a46
  1. 3
      xdiff/xemit.c

3
xdiff/xemit.c

@ -86,8 +86,7 @@ static void xdl_find_func(xdfile_t *xf, long i, char *buf, long sz, long *ll) { @@ -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]))

Loading…
Cancel
Save