fix regex error message parsing (GRegex indexes subgroups, not matches)

This commit is contained in:
Dimitar Zhekov 2014-01-21 20:22:28 +02:00 committed by elextr
parent b1d6291f7d
commit df9a1b15c6

View File

@ -1288,11 +1288,27 @@ gboolean filetypes_parse_error_message(GeanyFiletype *ft, const gchar *message,
}
if (g_match_info_get_match_count(minfo) >= 3)
{
gchar *first, *second, *end;
gchar *first = NULL, *second, *end;
glong l;
gint i;
for (i = 1; ; i++)
{
gint start_pos;
g_match_info_fetch_pos(minfo, i, &start_pos, NULL);
if (start_pos != -1)
{
if (first == NULL)
first = g_match_info_fetch(minfo, i);
else
{
second = g_match_info_fetch(minfo, i);
break;
}
}
}
first = g_match_info_fetch(minfo, 1);
second = g_match_info_fetch(minfo, 2);
l = strtol(first, &end, 10);
if (*end == '\0') /* first is purely decimals */
{