Package: glib2.0 / 2.42.1-1

regex-test-do-not-assert-that-system-PCRE-allows-P-1.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From 070c9e965ac43f851bebc1ed653e9b468ec73cc8 Mon Sep 17 00:00:00 2001
From: Simon McVittie <simon.mcvittie@collabora.co.uk>
Date: Sun, 20 Jul 2014 19:34:54 +0100
Subject: [PATCH 3/4] regex test: do not assert that system PCRE allows
 "(?P<1>)"

Perl >= 5.18, and PCRE >= 8.34, disallow this.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=733325
---
 glib/tests/regex.c | 3 +++
 1 file changed, 3 insertions(+)

--- a/glib/tests/regex.c
+++ b/glib/tests/regex.c
@@ -2569,8 +2569,11 @@
   TEST_EXPAND("a", "a", "\\0130", FALSE, "X");
   TEST_EXPAND("a", "a", "\\\\\\0", FALSE, "\\a");
   TEST_EXPAND("a(?P<G>.)c", "xabcy", "X\\g<G>X", FALSE, "XbX");
+#ifndef USE_SYSTEM_PCRE
+  /* PCRE >= 8.34 no longer allows this usage. */
   TEST_EXPAND("(.)(?P<1>.)", "ab", "\\1", FALSE, "a");
   TEST_EXPAND("(.)(?P<1>.)", "ab", "\\g<1>", FALSE, "a");
+#endif
   TEST_EXPAND(".", EURO, "\\0", FALSE, EURO);
   TEST_EXPAND("(.)", EURO, "\\1", FALSE, EURO);
   TEST_EXPAND("(?P<G>.)", EURO, "\\g<G>", FALSE, EURO);