git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xdiff/xemit.c (xdl_find_func): Elide trailing white space in a context header.
@ 2006-10-23 20:22 Jim Meyering
  2006-10-23 20:49 ` Linus Torvalds
  0 siblings, 1 reply; 6+ messages in thread
From: Jim Meyering @ 2006-10-23 20:22 UTC (permalink / raw)
  To: git

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

Signed-off-by: Jim Meyering <jim@meyering.net>
---
 xdiff/xemit.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xdiff/xemit.c b/xdiff/xemit.c
index 714c563..1bca639 100644
--- a/xdiff/xemit.c
+++ b/xdiff/xemit.c
@@ -92,6 +92,8 @@ static void xdl_find_func(xdfile_t *xf,
 				len = sz;
 			if (len && rec[len - 1] == '\n')
 				len--;
+			while (0 < len && isspace ((unsigned char) rec[len - 1]))
+				len--;
 			memcpy(buf, rec, len);
 			*ll = len;
 			return;
--
1.4.3.1.g178e-dirty

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-10-23 21:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-23 20:22 [PATCH] xdiff/xemit.c (xdl_find_func): Elide trailing white space in a context header Jim Meyering
2006-10-23 20:49 ` Linus Torvalds
2006-10-23 21:03   ` Petr Baudis
2006-10-23 21:10     ` Linus Torvalds
2006-10-23 21:15       ` Jakub Narebski
2006-10-23 21:06   ` Jakub Narebski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).