[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