From: Jim Meyering Date: Thu, 15 Dec 2005 20:15:20 +0000 (+0000) Subject: (print_it): Properly handle a backslash at the X-Git-Tag: v6.0~1102 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ce79c562f680b0247849a1ae2943699073371b70;p=thirdparty%2Fcoreutils.git (print_it): Properly handle a backslash at the end of a --printf format string. Reported by Paul Eggert. --- diff --git a/src/stat.c b/src/stat.c index 0773860ad5..0ce83d173f 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);