Parcourir la source

Dpkg::ErrorHandling::syntaxerr(): handle supplementary parameters like report()

That is consider that the string is a format string that needs to be
processed with sprintf().
Raphaël Hertzog il y a 15 ans
Parent
commit
8eed1ffef9
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      scripts/Dpkg/ErrorHandling.pm

+ 3 - 1
scripts/Dpkg/ErrorHandling.pm

@@ -109,7 +109,9 @@ sub usageerr(@)
 }
 
 sub syntaxerr {
-    my ($file, $msg) = @_;
+    my ($file, $msg) = (shift, shift);
+
+    $msg = sprintf($msg, @_) if (@_);
     error(_g("syntax error in %s at line %d: %s"), $file, $., $msg);
 }