Skip to content

Commit 67aef03

Browse files
meyeringJunio C Hamano
authored andcommitted
xdiff/xemit.c (xdl_find_func): Elide trailing white space in a context header.
This removes trailing blanks from git-generated diff headers the same way a similar patch did that for GNU diff: http://article.gmane.org/gmane.comp.gnu.utils.bugs/13839 That is, it removes trailing blanks on the hunk header line that shows the function name. Signed-off-by: Jim Meyering <jim@meyering.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 810799e commit 67aef03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xdiff/xemit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static void xdl_find_func(xdfile_t *xf, long i, char *buf, long sz, long *ll) {
9090
*rec == '#')) { /* #define? */
9191
if (len > sz)
9292
len = sz;
93-
if (len && rec[len - 1] == '\n')
93+
while (0 < len && isspace((unsigned char)rec[len - 1]))
9494
len--;
9595
memcpy(buf, rec, len);
9696
*ll = len;

0 commit comments

Comments
 (0)