Explorar o código

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 %!s(int64=14) %!d(string=hai) anos
pai
achega
b0d79a3227
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  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;