[SCM] ki18n packaging branch, master, updated. debian/5.28.0-1-4-gf1b7a95
Maximiliano Curia
maxy at moszumanska.debian.org
Mon Apr 3 10:05:44 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/frameworks/ki18n.git;a=commitdiff;h=e8c14d1
The following commit has been merged in the master branch:
commit e8c14d1044418138f1e2682e88ef5182b9a1ad16
Author: Maximiliano Curia <maxy at gnuservers.com.ar>
Date: Mon Apr 3 11:48:03 2017 +0200
Add new upstream patch: Check-properly-pointer-inequality-from-dngettext.patch
---
...roperly-pointer-inequality-from-dngettext.patch | 43 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 44 insertions(+)
diff --git a/debian/patches/Check-properly-pointer-inequality-from-dngettext.patch b/debian/patches/Check-properly-pointer-inequality-from-dngettext.patch
new file mode 100644
index 0000000..8419283
--- /dev/null
+++ b/debian/patches/Check-properly-pointer-inequality-from-dngettext.patch
@@ -0,0 +1,43 @@
+From: =?utf-8?q?=22Chusslove_Illich_=28=D0=A7=D0=B0=D1=81=D0=BB=D0=B0?=
+ =?utf-8?q?=D0=B2_=D0=98=D0=BB=D0=B8=D1=9B=29=22?= <caslav.ilic at gmx.net>
+Date: Sun, 20 Nov 2016 23:31:30 +0100
+Subject: Check properly pointer inequality from dngettext
+
+If original and translation are same, dngettext will return
+the original pointer, which is generally fine, except in
+the corner cases where e.g. msgstr[1] is same as msgid.
+Therefore check for pointer difference only with msgid or
+only with msgid_plural, and not with both.
+
+BUG: 372681
+---
+ src/kcatalog.cpp | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/kcatalog.cpp b/src/kcatalog.cpp
+index 6682d62..85d64ab 100644
+--- a/src/kcatalog.cpp
++++ b/src/kcatalog.cpp
+@@ -226,7 +226,12 @@ QString KCatalog::translate(const QByteArray &msgid,
+ d->setupGettextEnv();
+ const char *msgstr = dngettext(d->domain.constData(), msgid.constData(), msgid_plural.constData(), n);
+ d->resetSystemLanguage();
+- return msgstr != msgid && msgstr != msgid_plural
++ // If original and translation are same, dngettext will return
++ // the original pointer, which is generally fine, except in
++ // the corner cases where e.g. msgstr[1] is same as msgid.
++ // Therefore check for pointer difference only with msgid or
++ // only with msgid_plural, and not with both.
++ return (n == 1 && msgstr != msgid) || (n != 1 && msgstr != msgid_plural)
+ ? QString::fromUtf8(msgstr)
+ : QString();
+ } else {
+@@ -244,7 +249,7 @@ QString KCatalog::translate(const QByteArray &msgctxt,
+ d->setupGettextEnv();
+ const char *msgstr = dnpgettext_expr(d->domain.constData(), msgctxt.constData(), msgid.constData(), msgid_plural.constData(), n);
+ d->resetSystemLanguage();
+- return msgstr != msgid && msgstr != msgid_plural
++ return (n == 1 && msgstr != msgid) || (n != 1 && msgstr != msgid_plural)
+ ? QString::fromUtf8(msgstr)
+ : QString();
+ } else {
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..31efb62
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+Check-properly-pointer-inequality-from-dngettext.patch
--
ki18n packaging
More information about the pkg-kde-commits
mailing list