mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-09 12:25:48 +01:00
Handle J changes in the pattern correctly. (#444765, Yevgen Muntyan)
2007-08-03 Matthias Clasen <mclasen@redhat.com> * glib/gregex.c: Handle J changes in the pattern correctly. (#444765, Yevgen Muntyan) svn path=/trunk/; revision=5669
This commit is contained in:
parent
087097908c
commit
d9ef72e4e9
@ -1,3 +1,8 @@
|
|||||||
|
2007-08-03 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* glib/gregex.c: Handle J changes in the pattern
|
||||||
|
correctly. (#444765, Yevgen Muntyan)
|
||||||
|
|
||||||
2007-08-03 Pramod Raghavendra <pramodleo@yahoo.co.uk>
|
2007-08-03 Pramod Raghavendra <pramodleo@yahoo.co.uk>
|
||||||
|
|
||||||
* configure.in: Added kn to ALL_LINGUAS
|
* configure.in: Added kn to ALL_LINGUAS
|
||||||
|
@ -623,18 +623,8 @@ get_matched_substring_number (const GMatchInfo *match_info,
|
|||||||
gchar *first, *last;
|
gchar *first, *last;
|
||||||
guchar *entry;
|
guchar *entry;
|
||||||
|
|
||||||
/*
|
#if PCRE_MAJOR > 7 || PCRE_MINOR >= 2
|
||||||
* FIXME: (?J) may be used inside the pattern as the equivalent of
|
if (!(match_info->regex->compile_opts & G_REGEX_DUPNAMES))
|
||||||
* DUPNAMES compile option. In this case we can't know about it,
|
|
||||||
* and pcre doesn't tell us about it either, it uses private flag
|
|
||||||
* PCRE_JCHANGED for this. So we have to always search string
|
|
||||||
* table, unlike pcre which uses pcre_get_stringnumber() shortcut
|
|
||||||
* when possible. It shouldn't be actually bad since
|
|
||||||
* pcre_get_stringtable_entries() uses binary search; still would
|
|
||||||
* be better to fix it, to be not worse than pcre.
|
|
||||||
*/
|
|
||||||
#if 0
|
|
||||||
if ((match_info->regex->compile_opts & G_REGEX_DUPNAMES) == 0)
|
|
||||||
return pcre_get_stringnumber (match_info->regex->pcre_re, name);
|
return pcre_get_stringnumber (match_info->regex->pcre_re, name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -863,7 +853,7 @@ g_regex_new (const gchar *pattern,
|
|||||||
gint erroffset;
|
gint erroffset;
|
||||||
gboolean optimize = FALSE;
|
gboolean optimize = FALSE;
|
||||||
static gboolean initialized = FALSE;
|
static gboolean initialized = FALSE;
|
||||||
|
|
||||||
g_return_val_if_fail (pattern != NULL, NULL);
|
g_return_val_if_fail (pattern != NULL, NULL);
|
||||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||||
g_return_val_if_fail ((compile_options & ~G_REGEX_COMPILE_MASK) == 0, NULL);
|
g_return_val_if_fail ((compile_options & ~G_REGEX_COMPILE_MASK) == 0, NULL);
|
||||||
@ -939,6 +929,16 @@ g_regex_new (const gchar *pattern,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PCRE_MAJOR > 7 || PCRE_MINOR >= 2
|
||||||
|
if (!(compile_options & G_REGEX_DUPNAMES))
|
||||||
|
{
|
||||||
|
gboolean jchanged = FALSE;
|
||||||
|
pcre_fullinfo (re, NULL, PCRE_INFO_JCHANGED, &jchanged);
|
||||||
|
if (jchanged)
|
||||||
|
compile_options |= G_REGEX_DUPNAMES;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
regex = g_new0 (GRegex, 1);
|
regex = g_new0 (GRegex, 1);
|
||||||
regex->ref_count = 1;
|
regex->ref_count = 1;
|
||||||
regex->pattern = g_strdup (pattern);
|
regex->pattern = g_strdup (pattern);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user