From ce79c562f680b0247849a1ae2943699073371b70 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 15 Dec 2005 20:15:20 +0000 Subject: (print_it): Properly handle a backslash at the end of a --printf format string. Reported by Paul Eggert. --- src/stat.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/stat.c b/src/stat.c index 0773860ad..0ce83d173 100644 --- a/src/stat.c +++ b/src/stat.c @@ -665,6 +665,13 @@ print_it (char const *format, char const *filename, } putchar (esc_value); } + else if (*b == '\0') + { + error (0, 0, _("warning: backslash at end of format")); + putchar ('\\'); + /* Arrange to exit the loop. */ + --b; + } else { print_esc_char (*b); -- cgit v1.2.3-70-g09d2