mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-12-10 10:33:42 +01:00
regex: Fix newline definition for system PCRE
While we PCRE_BSR_UNICODE is the default in the internal PCRE, that may not be true for the system one. Force the PCRE_BSR_UNICODE flag on it.
This commit is contained in:
@@ -1320,6 +1320,12 @@ g_regex_new (const gchar *pattern,
|
||||
|
||||
compile_options |= PCRE_UCP;
|
||||
|
||||
/* PCRE_BSR_UNICODE is the default for the internal PCRE but
|
||||
* possibly not for the system one.
|
||||
*/
|
||||
if (~compile_options & G_REGEX_BSR_ANYCRLF)
|
||||
compile_options |= PCRE_BSR_UNICODE;
|
||||
|
||||
/* compile the pattern */
|
||||
re = pcre_compile2 (pattern, compile_options, &errcode,
|
||||
&errmsg, &erroffset, NULL);
|
||||
|
||||
Reference in New Issue
Block a user