This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=e3c32720167a6c23fc19471d3e3273965c3dc9e5

commit e3c32720167a6c23fc19471d3e3273965c3dc9e5
Author: Guillem Jover <[email protected]>
AuthorDate: Sat Jul 28 04:08:58 2018 +0200

    Dpkg::Gettext: Fix fallback textdomain() to honor its expected interface
    
    Even though we will not use the domain value set by this function, we
    should honor its original interface and return a domain string, and
    update it when requested.
---
 debian/changelog        | 1 +
 scripts/Dpkg/Gettext.pm | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 5a7b8630f..d818667d2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -129,6 +129,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium
       _add_build_flags(), for a small speed up and line count reduction.
     - Dpkg::BuildFlags: Move default flags setting into the Dpkg::Vendor
       modules.
+    - Dpkg::Gettext: Fix fallback textdomain() to honor its expected interface.
   * Documentation:
     - Update gettext minimal version in README.
     - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph.
diff --git a/scripts/Dpkg/Gettext.pm b/scripts/Dpkg/Gettext.pm
index 33ef1c48d..89a4d154f 100644
--- a/scripts/Dpkg/Gettext.pm
+++ b/scripts/Dpkg/Gettext.pm
@@ -28,6 +28,7 @@ package Dpkg::Gettext;
 
 use strict;
 use warnings;
+use feature qw(state);
 
 our $VERSION = '1.03';
 our @EXPORT = qw(
@@ -122,6 +123,12 @@ BEGIN {
             return shift;
         };
         *textdomain = sub {
+            my $new_domain = shift;
+            state $domain = $DEFAULT_TEXT_DOMAIN;
+
+            $domain = $new_domain if defined $new_domain;
+
+            return $domain;
         };
         *ngettext = sub {
             my ($msgid, $msgid_plural, $n) = @_;

-- 
Dpkg.Org's dpkg

Reply via email to