Sfoglia il codice sorgente

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 15 anni fa
parent
commit
8eed1ffef9
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      scripts/Dpkg/ErrorHandling.pm

+ 3 - 1
scripts/Dpkg/ErrorHandling.pm

@@ -109,7 +109,9 @@ sub usageerr(@)
 }
 }
 
 
 sub syntaxerr {
 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);
     error(_g("syntax error in %s at line %d: %s"), $file, $., $msg);
 }
 }