Explorar el Código

dpkg-source: Fix perl warning when typing Ctrl-D on patch name prompt

When prompting the user for a patch name, if they type Ctrl-D the
variable reading from STDIN will be initialized to undef, but we were
acting on it anyway. Catch that case.
Guillem Jover hace 12 años
padre
commit
81f0fdb71a
Se han modificado 2 ficheros con 4 adiciones y 1 borrados
  1. 1 0
      debian/changelog
  2. 3 1
      scripts/Dpkg/Source/Package/V2.pm

+ 1 - 0
debian/changelog

@@ -8,6 +8,7 @@ dpkg (1.17.14) UNRELEASED; urgency=low
   * Bump Standards-Version to 3.9.6 (no changes needed).
   * Disable unused run-time type information for dselect.
   * Fix compiler flag detection with non-GCC compilers in the build system.
+  * Fix perl warning on dpkg-source when typing Ctrl-D on patch name prompt.
 
   [ Raphaël Hertzog ]
   * Explain better in deb-triggers(5) why interest/activate-noawait should be

+ 3 - 1
scripts/Dpkg/Source/Package/V2.pm

@@ -654,7 +654,9 @@ sub do_commit {
     while (_is_bad_patch_name($dir, $patch_name)) {
         # Ask the patch name interactively
         print _g('Enter the desired patch name: ');
-        chomp($patch_name = <STDIN>);
+        $patch_name = <STDIN>;
+        next unless defined $patch_name;
+        chomp $patch_name;
         $patch_name =~ s/\s+/-/g;
         $patch_name =~ s/\///g;
     }