Skip to content

Commit 70da769

Browse files
Petr BaudisJunio C Hamano
authored andcommitted
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>
1 parent 6e7d76b commit 70da769

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

xdiff/xemit.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ static void xdl_find_func(xdfile_t *xf, long i, char *buf, long sz, long *ll) {
8686
if (len > 0 &&
8787
(isalpha((unsigned char)*rec) || /* identifier? */
8888
*rec == '_' || /* also identifier? */
89-
*rec == '(' || /* lisp defun? */
90-
*rec == '#')) { /* #define? */
89+
*rec == '$')) { /* mysterious GNU diff's invention */
9190
if (len > sz)
9291
len = sz;
9392
while (0 < len && isspace((unsigned char)rec[len - 1]))

0 commit comments

Comments
 (0)