From 1c95d2c3ae3e6aa714d021abc661aa9251825276 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 28 Jan 2011 09:04:53 +0100 Subject: [PATCH] Relaxed fishy checks for dux format modifiers --- src/scripts/scan_boost_format_strings.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scripts/scan_boost_format_strings.pl b/src/scripts/scan_boost_format_strings.pl index cd9fc84a4..b4255afc2 100755 --- a/src/scripts/scan_boost_format_strings.pl +++ b/src/scripts/scan_boost_format_strings.pl @@ -108,14 +108,14 @@ sub scan_file { $fishy = 0 if ( $rest =~ m/^\%/ || $rest =~ m/^\d+\%/ - || $rest =~ m/^\|\d+\$\d+[duxX]\|/ + || $rest =~ m/^\|\d+\$\d*[duxX]\|/ || $rest =~ m/^\|\d+\$[\+\-]?\d+[fs]\|/ || $rest =~ m/^\|\d+\$[\+\-]?\d*\.\d+[fs]\|/); my $format = $&; my $checksum = sha1_base64($file_name . $format_cont); if ($fishy) { - push @errors, "Fishy format at ${file_name}:${line_number}:" . ($pos - 1) . " $checksum\n"; + push @errors, "Fishy format at ${file_name}:${line_number} (" . ($pos - 1) . ") $checksum\n"; $pos++; $num_fishs++; @@ -123,7 +123,7 @@ sub scan_file { $nth_arg++ if ($format ne '%'); if (($format =~ m/^(\d+)\%$/) || ($format =~ m/^\|(\d+)\$/)) { if (($nth_arg != ($1 * 1)) && !$ignore{$checksum}) { - push @errors, "Bad arg at ${file_name}:${line_number}:" . ($pos - 1) . " (expected $nth_arg, got $1) $checksum\n"; + push @errors, "Bad arg at ${file_name}:${line_number} (" . ($pos - 1) . ") (expected $nth_arg, got $1) $checksum\n"; } $format =~ s/^\|\d+\$/|1\$/; }