]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(print_it): Properly handle a backslash at the
authorJim Meyering <jim@meyering.net>
Thu, 15 Dec 2005 20:15:05 +0000 (20:15 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 15 Dec 2005 20:15:05 +0000 (20:15 +0000)
end of a --printf format string.  Reported by Paul Eggert.

(end-bs): Add a test for the above.

tests/misc/stat-printf

index 1b8dd85b16a8209ba4489e9a4da34dbd9af1466d..13a63c4d96083a95dc47b3e620915b66ee9047d6 100755 (executable)
@@ -43,6 +43,8 @@ my @Tests =
 
      ['end-pct', "--printf=% .",       {OUT=>"%"}],
      ['pct-pct', "--printf=%% .",      {OUT=>"%"}],
+     ['end-bs',  "--printf='\\' .",    {OUT=>'\\'},
+        {ERR=>"$prog: warning: backslash at end of format\n"}],
 
      ['err-1', "--printf=%9% .",       {EXIT => 1},
         {ERR=>"$prog: %9%: invalid directive\n"}],