]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(batch_convert): Remove any trailing newline from offending
authorJim Meyering <jim@meyering.net>
Mon, 27 Feb 1995 06:00:14 +0000 (06:00 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 27 Feb 1995 06:00:14 +0000 (06:00 +0000)
line before including it in the `invalid date' error from `date -f'.
Reported by Franc,ois Pinard.

src/date.c

index f9dccb98b04225acdcc123bb4932787d8fbe65e9..b1c87448c477c2937e20f9cef1d7ff6e631e53c4 100644 (file)
@@ -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;
        }