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>
Jim Meyering committed
Oct 23, 2006 at 22:22 UTC
67aef034551aed0cc417e8b758a59b9978c4f3f1
1 file changed
+1
-1
xdiff/xemit.c
+1
-1
@@ -90,7 +90,7 @@ static void xdl_find_func(xdfile_t *xf, long i, char *buf, long sz, long *ll) {
90
*rec == '#')) { /* #define? */
91
if (len > sz)
92
len = sz;
93
- if (len && rec[len - 1] == '\n')
93
+ while (0 < len && isspace((unsigned char)rec[len - 1]))
94
len--;
95
memcpy(buf, rec, len);
96
*ll = len;