From 5a5938db828ab6059f7600692f5c5006873b9bcc Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 29 Apr 1996 01:28:06 +0000 Subject: [PATCH] =?utf8?q?(copy=5Frest):=20Don't=20copy=20past=20end=20of?= =?utf8?q?=20prefix.=20=20Output=20trailing=20spaces=20if=20the=20prefix?= =?utf8?q?=20had=20any.=20=20Before,=20the=20command=20perl=20-e=20'print?= =?utf8?q?=20"|=20S";'=20|fmt=20-p'=20|=20=20'|tr=20'\0'=20@=20output=20`|?= =?utf8?q?@S'.=20Reported=20by=20Fran=E7ois=20Pinard.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/fmt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fmt.c b/src/fmt.c index 534bdb1..6c7b569 100644 --- a/src/fmt.c +++ b/src/fmt.c @@ -575,8 +575,9 @@ copy_rest (FILE *f, register int c) if (in_column > next_prefix_indent && c != '\n' && c != EOF) { put_space (next_prefix_indent); - for (s = prefix; out_column != in_column; out_column++) + for (s = prefix; out_column != in_column && *s; out_column++) putchar (*s++); + put_space (in_column - out_column); } while (c != '\n' && c != EOF) { -- 2.7.4