git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] xdiff/xemit.c (xdl_find_func): Elide trailing white space in a context header.

From
Jim Meyering <jim@meyering.net>
Date
Oct 23, 2006, 20:22 UTC
Message-ID
<87y7r63hq6.fsf@rho.meyering.net>

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
Next: Linus Torvalds
Message 1 of 6 in “xdiff/xemit.c (xdl_find_func): Elide trailing white space in a context header.”
  1. xdiff/xemit.c (xdl_find_func): Elide trailing white space in a context header.Jim Meyering, Oct 23, 2006
  2. Linus TorvaldsOct 23, 2006
  3. Petr BaudisOct 23, 2006
  4. Linus TorvaldsOct 23, 2006
  5. Jakub NarebskiOct 23, 2006
  6. Jakub NarebskiOct 23, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.