mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
When the compilation of a pattern fails in the error message use the
2007-11-19 Marco Barisione <marco@barisione.org> * glib/gregex.c: When the compilation of a pattern fails in the error message use the character offset and not the byte offset. svn path=/trunk/; revision=5867
This commit is contained in:
parent
c8de81804c
commit
d887ff42eb
@ -1,3 +1,8 @@
|
|||||||
|
2007-11-19 Marco Barisione <marco@barisione.org>
|
||||||
|
|
||||||
|
* glib/gregex.c: When the compilation of a pattern fails in the error
|
||||||
|
message use the character offset and not the byte offset.
|
||||||
|
|
||||||
2007-11-19 10:30:33 Tim Janik <timj@imendio.com>
|
2007-11-19 10:30:33 Tim Janik <timj@imendio.com>
|
||||||
|
|
||||||
* configure.in: updated version number to 2.15.0 for development.
|
* configure.in: updated version number to 2.15.0 for development.
|
||||||
|
@ -924,11 +924,16 @@ g_regex_new (const gchar *pattern,
|
|||||||
* immediately */
|
* immediately */
|
||||||
if (re == NULL)
|
if (re == NULL)
|
||||||
{
|
{
|
||||||
GError *tmp_error = g_error_new (G_REGEX_ERROR,
|
GError *tmp_error;
|
||||||
G_REGEX_ERROR_COMPILE,
|
|
||||||
_("Error while compiling regular "
|
/* PCRE uses byte offsets but we want to show character offsets */
|
||||||
"expression %s at char %d: %s"),
|
erroffset = g_utf8_pointer_to_offset (pattern, &pattern[erroffset]);
|
||||||
pattern, erroffset, errmsg);
|
|
||||||
|
tmp_error = g_error_new (G_REGEX_ERROR,
|
||||||
|
G_REGEX_ERROR_COMPILE,
|
||||||
|
_("Error while compiling regular "
|
||||||
|
"expression %s at char %d: %s"),
|
||||||
|
pattern, erroffset, errmsg);
|
||||||
g_propagate_error (error, tmp_error);
|
g_propagate_error (error, tmp_error);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user