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

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 лет назад: 12
Родитель
Сommit
81f0fdb71a
2 измененных файлов с 4 добавлено и 1 удалено
  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;
     }