summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-devel/gettext/files/gettext-0.17-x-python.patch')
-rw-r--r--sys-devel/gettext/files/gettext-0.17-x-python.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/sys-devel/gettext/files/gettext-0.17-x-python.patch b/sys-devel/gettext/files/gettext-0.17-x-python.patch
new file mode 100644
index 000000000000..20d55f8a32ba
--- /dev/null
+++ b/sys-devel/gettext/files/gettext-0.17-x-python.patch
@@ -0,0 +1,28 @@
+From a6fed64abcc079877b33804420c666b867b50987 Mon Sep 17 00:00:00 2001
+From: Bruno Haible <bruno@clisp.org>
+Date: Sun, 03 Aug 2008 20:00:25 +0000
+Subject: Handle lone high surrogates gracefully.
+
+2008-08-03 Bruno Haible <bruno@clisp.org>
+
+ * x-python.c (mixed_string_buffer_append): Replace a lone high
+ surrogate with U+FFFD.
+ Reported by Yann <asterix@lagaule.org>
+ via Santiago Vila <sanvila@unex.es>.
+
+diff --git a/gettext-tools/src/x-python.c b/gettext-tools/src/x-python.c
+index e6dcc31..e05aca4 100644
+--- a/gettext-tools/src/x-python.c
++++ b/gettext-tools/src/x-python.c
+@@ -930,6 +930,11 @@ mixed_string_buffer_append (struct mixed_string_buffer *bp, int c)
+
+ if (c >= UNICODE (0xd800) && c < UNICODE (0xdc00))
+ bp->utf16_surr = UNICODE_VALUE (c);
++ else if (c >= UNICODE (0xdc00) && c < UNICODE (0xe000))
++ {
++ /* A half surrogate is invalid, therefore use U+FFFD instead. */
++ mixed_string_buffer_append_unicode (bp, 0xfffd);
++ }
+ else
+ mixed_string_buffer_append_unicode (bp, UNICODE_VALUE (c));
+ }