From 19397f6b83f488de0e54c7ea4972e86515677752 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 5 Sep 2006 14:04:57 +0000 Subject: [PATCH] * src/context.c (print_context_function): Do not print trailing white space in a context header. --- ChangeLog | 5 +++++ src/context.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8d4e9c4..3af1c19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-09-04 Jim Meyering + + * src/context.c (print_context_function): Do not print + trailing white space in a context header. + 2006-05-09 Paul Eggert * src/cmp.c (cmp): The previous fix wasn't quite right either, as diff --git a/src/context.c b/src/context.c index 435930b..8c59961 100644 --- a/src/context.c +++ b/src/context.c @@ -137,6 +137,8 @@ print_context_function (FILE *out, char const *function) putc (' ', out); for (i = 0; i < 40 && function[i] != '\n'; i++) continue; + while (0 < i && isspace ((unsigned char) function[i - 1])) + i--; fwrite (function, sizeof (char), i, out); }