From 0fbf304b545a529e4f2bccf41fca8db5805de075 Mon Sep 17 00:00:00 2001 From: Brian Feldman Date: Fri, 15 Sep 2000 11:35:16 +0000 Subject: [PATCH] Also coerce diff(1) into working the other way (from no-\n to \n). Taking out the evil warning fixed it one way, but didn't make the other way any better, so replace it with printing a single \n. --- contrib/diff/util.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/diff/util.c b/contrib/diff/util.c index 3cd3f91fc4e0..a1e46dc95729 100644 --- a/contrib/diff/util.c +++ b/contrib/diff/util.c @@ -483,6 +483,9 @@ print_1_line (line_flag, line) } output_1_line (text, limit, flag_format, line_flag); + + if ((!line_flag || line_flag[0]) && limit[-1] != '\n') + fputc ('\n', out); } /* Output a line from TEXT up to LIMIT. Without -t, output verbatim.