Date: Wed, 10 Aug 2011 21:39:47 +0000 (UTC) From: Gabor Kovesdan <gabor@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r224767 - user/gabor/tre-integration/contrib/tre/lib Message-ID: <201108102139.p7ALdlNv062458@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gabor Date: Wed Aug 10 21:39:47 2011 New Revision: 224767 URL: http://svn.freebsd.org/changeset/base/224767 Log: - Fix a wchar-cleanness issue - TRE-specific style Modified: user/gabor/tre-integration/contrib/tre/lib/fastmatch.c Modified: user/gabor/tre-integration/contrib/tre/lib/fastmatch.c ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/fastmatch.c Wed Aug 10 21:32:13 2011 (r224766) +++ user/gabor/tre-integration/contrib/tre/lib/fastmatch.c Wed Aug 10 21:39:47 2011 (r224767) @@ -475,38 +475,46 @@ tre_fastexec(const fastmatch_t *fg, cons shift = fg->len; } - /* XXX: make wchar-clean */ /* Only try once at the beginning or ending of the line. */ - if (fg->bol || fg->eol) { - /* Simple text comparison. */ - if (!((fg->bol && fg->eol) && (len != fg->len))) { - /* Determine where in data to start search at. */ - j = fg->eol ? len - fg->len : 0; - SKIP_CHARS(j); - COMPARE; - if (mismatch == REG_OK) { - pmatch[0].rm_so = j; - pmatch[0].rm_eo = j + fg->len; - return REG_OK; - } + if (fg->bol || fg->eol) + { + /* Simple text comparison. */ + if (!((fg->bol && fg->eol) && + (type == STR_WIDE ? (wlen != fg->wlen) : (len != fg->len)))) + { + /* Determine where in data to start search at. */ + j = fg->eol ? len - (type == STR_WIDE ? fg->wlen : fg->len) : 0; + SKIP_CHARS(j); + COMPARE; + if (mismatch == REG_OK) + { + pmatch[0].rm_so = j; + pmatch[0].rm_eo = j + (type == STR_WIDE ? fg->wlen : fg->len); + return REG_OK; + } + } } - } else { - /* Quick Search algorithm. */ - j = 0; - do { - SKIP_CHARS(j); - COMPARE; - if (mismatch == REG_OK) { - pmatch[0].rm_so = j; - pmatch[0].rm_eo = j + ((type == STR_WIDE) ? fg->wlen : fg->len); - return REG_OK; - } else if (mismatch > 0) - return mismatch; - mismatch = -mismatch - 1; - SHIFT; - } while (!IS_OUT_OF_BOUNDS); - } - return ret; + else + { + /* Quick Search algorithm. */ + j = 0; + do + { + SKIP_CHARS(j); + COMPARE; + if (mismatch == REG_OK) + { + pmatch[0].rm_so = j; + pmatch[0].rm_eo = j + ((type == STR_WIDE) ? fg->wlen : fg->len); + return REG_OK; + } + else if (mismatch > 0) + return mismatch; + mismatch = -mismatch - 1; + SHIFT; + } while (!IS_OUT_OF_BOUNDS); + } + return ret; } void
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108102139.p7ALdlNv062458>