"Redundant argument in sprintf" warning spam from prepare-ChangeLog
https://bugs.webkit.org/show_bug.cgi?id=161606
Reviewed by Darin Adler.
Avoid extra arguments in call to sprintf, hopefully without introducing new warnings this
time.
* Scripts/prepare-ChangeLog:
(statusDescription):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@205483 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Tools/Scripts/prepare-ChangeLog b/Tools/Scripts/prepare-ChangeLog
index b3bdf5e..f2e7a56 100755
--- a/Tools/Scripts/prepare-ChangeLog
+++ b/Tools/Scripts/prepare-ChangeLog
@@ -2325,21 +2325,23 @@
my $propertyDescription = defined $propertyChanges ? propertyChangeDescription($propertyChanges) : "";
my %svn = (
- "A" => defined $original ? " Copied from \%s." : " Added.",
+ "A" => defined $original ? sprintf(" Copied from \%s.", $original) : " Added.",
"D" => " Removed.",
"M" => "",
- "R" => defined $original ? " Replaced with \%s." : " Replaced.",
+ "R" => defined $original ? sprintf(" Replaced with \%s.", $original) : " Replaced.",
" " => "",
);
my %git = %svn;
$git{"A"} = " Added.";
- $git{"C"} = " Copied from \%s.";
- $git{"R"} = " Renamed from \%s.";
+ if (defined $original) {
+ $git{"C"} = sprintf(" Copied from \%s.", $original);
+ $git{"R"} = sprintf(" Renamed from \%s.", $original);
+ }
my $description;
- $description = sprintf($svn{$status}, $original) if isSVN() && exists $svn{$status};
- $description = sprintf($git{$status}, $original) if isGit() && exists $git{$status};
+ $description = $svn{$status} if isSVN() && exists $svn{$status};
+ $description = $git{$status} if isGit() && exists $git{$status};
return unless defined $description;
$description .= $propertyDescription unless isAddedStatus($status);