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

Dpkg::Source::Package::V2: Abort on EOF in patch name prompt

Instead of entering into an infinite loop.

Closes: #851441
Guillem Jover лет назад: 9
Родитель
Сommit
c786b8aaba
2 измененных файлов с 5 добавлено и 1 удалено
  1. 2 0
      debian/changelog
  2. 3 1
      scripts/Dpkg/Source/Package/V2.pm

+ 2 - 0
debian/changelog

@@ -6,6 +6,8 @@ dpkg (1.18.19) UNRELEASED; urgency=medium
       matchings work. Missed in dpkg 1.18.11.
       matchings work. Missed in dpkg 1.18.11.
       Reported by Julian Andres Klode <jak@debian.org>.
       Reported by Julian Andres Klode <jak@debian.org>.
     - Add new import tags for Dpkg::Arch.
     - Add new import tags for Dpkg::Arch.
+    - Abort on EOF in patch name prompt in Dpkg::Source::Package::V2,
+      instead of getting into an infinite loop. Closes: #851441
   * Documentation:
   * Documentation:
     - Cleanup software requirements in README.
     - Cleanup software requirements in README.
     - Move control member file references from dpkg(1) to deb(5).
     - Move control member file references from dpkg(1) to deb(5).

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

@@ -722,7 +722,9 @@ sub do_commit {
         # Ask the patch name interactively
         # Ask the patch name interactively
         print g_('Enter the desired patch name: ');
         print g_('Enter the desired patch name: ');
         $patch_name = <STDIN>;
         $patch_name = <STDIN>;
-        next unless defined $patch_name;
+        if (not defined $patch_name) {
+            error(g_('no patch name given; cannot proceed'));
+        }
         chomp $patch_name;
         chomp $patch_name;
         $patch_name =~ s/\s+/-/g;
         $patch_name =~ s/\s+/-/g;
         $patch_name =~ s/\///g;
         $patch_name =~ s/\///g;