Просмотр исходного кода

Dpkg::Source::Functions::is_binary(): localize $_ to avoid side-effects

Without this local($_) the function could modify the $_ variable as used
by the caller.
Raphaël Hertzog лет назад: 14
Родитель
Сommit
b0d79a3227
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      scripts/Dpkg/Source/Functions.pm

+ 1 - 0
scripts/Dpkg/Source/Functions.pm

@@ -102,6 +102,7 @@ sub is_binary($) {
         'to_pipe' => \$diffgen
     );
     my $result = 0;
+    local $_;
     while (<$diffgen>) {
         if (m/^(?:binary|[^-+\@ ].*\bdiffer\b)/i) {
             $result = 1;