summaryrefslogtreecommitdiff
path: root/xdiff
diff options
context:
space:
mode:
authorLibravatar Jim Meyering <jim@meyering.net>2006-10-23 22:22:25 +0200
committerLibravatar Junio C Hamano <junkio@cox.net>2006-10-23 14:33:54 -0700
commit67aef034551aed0cc417e8b758a59b9978c4f3f1 (patch)
tree804b1546ae08df67a8a7ec50d25d65647e044102 /xdiff
parentgit-clone: honor --quiet (diff)
downloadtgif-67aef034551aed0cc417e8b758a59b9978c4f3f1.tar.xz
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>
Diffstat (limited to 'xdiff')
-rw-r--r--xdiff/xemit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xdiff/xemit.c b/xdiff/xemit.c
index 714c563547..154c26fdcd 100644
--- a/xdiff/xemit.c
+++ b/xdiff/xemit.c
@@ -90,7 +90,7 @@ static void xdl_find_func(xdfile_t *xf, long i, char *buf, long sz, long *ll) {
*rec == '#')) { /* #define? */
if (len > sz)
len = sz;
- if (len && rec[len - 1] == '\n')
+ while (0 < len && isspace((unsigned char)rec[len - 1]))
len--;
memcpy(buf, rec, len);
*ll = len;