[Geany-Devel] fix for regex error message parsing

Dimitar Zhekov dimitar.zhekov at xxxxx
Tue Jan 21 18:42:13 UTC 2014


As discussed in the "Compiler tab suggestions" thread, Geany regex
error message parsing is buggy - it fetches the matching strings by
index, but GRegex indexes all subgroups, returning empty string for
the non-matching ones. So using | for alternatives does not work,
and parsing a set of strings like:

filename:line:column: warning: passing argument # of 'function' from
incompatible pointer type
In file included from filename:line,
from filename:line,
from filename:line:
filename:line:column: note: expected 'foo' but argument is of type 'bar'

is either impossible, or requires a very complex expression.
This is a regression caused by our switch to GRegex.

Fix attached. Of course, it's a simple loop skipping the non-matching
groups by their start position. Tested with both filename:line and

E-gards: Jimmy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fix-regex-error-message-parsing-GRegex-indexes-subgr.patch
Type: text/x-diff
Size: 1210 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20140121/0536371e/attachment.patch>

More information about the Devel mailing list