Explorar o código

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

Instead of entering into an infinite loop.

Closes: #851441
Guillem Jover %!s(int64=9) %!d(string=hai) anos
pai
achega
c786b8aaba
Modificáronse 2 ficheiros con 5 adicións e 1 borrados
  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.
       Reported by Julian Andres Klode <jak@debian.org>.
     - 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:
     - Cleanup software requirements in README.
     - 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
         print g_('Enter the desired patch name: ');
         $patch_name = <STDIN>;
-        next unless defined $patch_name;
+        if (not defined $patch_name) {
+            error(g_('no patch name given; cannot proceed'));
+        }
         chomp $patch_name;
         $patch_name =~ s/\s+/-/g;
         $patch_name =~ s/\///g;