After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 615706 - g_match_info_fetch incorrectly returns NULLs for non-matched capturing parentheses after matched string
g_match_info_fetch incorrectly returns NULLs for non-matched capturing parent...
Status: RESOLVED DUPLICATE of bug 588217
Product: glib
Classification: Platform
Component: gregex
2.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-04-14 06:05 UTC by Marat Radchenko
Modified: 2010-04-14 06:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testcase (731 bytes, text/x-csrc)
2010-04-14 06:17 UTC, Marat Radchenko
Details

Description Marat Radchenko 2010-04-14 06:05:54 UTC
According to g_match_info_fetch docs,
"If match_num is a valid sub pattern but it didn't match anything (e.g. sub pattern 1, matching "b" against "(a)?b") then an empty string is returned."

This is true for all sub pattern except those that are _after_ matched string.

Root of problem: http://git.gnome.org/browse/glib/tree/glib/gregex.c#n822

Testcase attached.
Comment 1 Marat Radchenko 2010-04-14 06:08:36 UTC
Woops, dupe of bug 588217

*** This bug has been marked as a duplicate of bug 588217 ***
Comment 2 Marat Radchenko 2010-04-14 06:17:45 UTC
Created attachment 158673 [details]
testcase