Date: Sun, 26 Feb 2012 19:01:00 +0000 (UTC) From: Gabor Kovesdan <gabor@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r232190 - user/gabor/tre-integration/contrib/tre/lib Message-ID: <201202261901.q1QJ10E5078694@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gabor Date: Sun Feb 26 19:00:59 2012 New Revision: 232190 URL: http://svn.freebsd.org/changeset/base/232190 Log: - Only set offset when REG_NOSUB was not specified and nmatch is greater then 0. Modified: user/gabor/tre-integration/contrib/tre/lib/mregexec.c Modified: user/gabor/tre-integration/contrib/tre/lib/mregexec.c ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/mregexec.c Sun Feb 26 18:54:45 2012 (r232189) +++ user/gabor/tre-integration/contrib/tre/lib/mregexec.c Sun Feb 26 19:00:59 2012 (r232190) @@ -263,12 +263,13 @@ finish2: pm, eflags); if ((ret == REG_OK) && (pm[0].rm_so == 0)) { - for (int i = 0; i < nmatch; i++) - { - pm[i].rm_so += st; - pm[i].rm_eo += st; - pm[i].p = rpm.p; - } + if (need_offsets) + for (int i = 0; i < nmatch; i++) + { + pm[i].rm_so += st; + pm[i].rm_eo += st; + pm[i].p = rpm.p; + } goto finish3; } else if ((ret != REG_NOMATCH) || (ret != REG_OK))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202261901.q1QJ10E5078694>