From: Jim Meyering Date: Mon, 27 Feb 1995 06:00:14 +0000 (+0000) Subject: (batch_convert): Remove any trailing newline from offending X-Git-Tag: textutils-1_12_1~282 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=829c2269542583fb67ccbdf1224bcdceebd90256;p=thirdparty%2Fcoreutils.git (batch_convert): Remove any trailing newline from offending line before including it in the `invalid date' error from `date -f'. Reported by Franc,ois Pinard. --- diff --git a/src/date.c b/src/date.c index f9dccb98b0..b1c87448c4 100644 --- a/src/date.c +++ b/src/date.c @@ -121,6 +121,8 @@ batch_convert (input_filename, format) when = get_date (line, NULL); if (when == -1) { + if (line[line_length - 1] == '\n') + line[line_length - 1] = '\0'; error (0, 0, "invalid date `%s'", line); status = 1; }