Date: Tue, 26 Jul 2011 01:06:44 +0000 (UTC) From: Gabor Kovesdan <gabor@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r224412 - user/gabor/tre-integration/contrib/tre/lib Message-ID: <201107260106.p6Q16itP084643@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gabor Date: Tue Jul 26 01:06:44 2011 New Revision: 224412 URL: http://svn.freebsd.org/changeset/base/224412 Log: - Defer converting to MBS pattern until it is sure that the compilation will succeed. 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 Mon Jul 25 23:01:08 2011 (r224411) +++ user/gabor/tre-integration/contrib/tre/lib/fastmatch.c Tue Jul 26 01:06:44 2011 (r224412) @@ -261,9 +261,6 @@ tre_fastcomp(fastmatch_t *fg, const tre_ return REG_ESPACE; memcpy(fg->wpattern, wpat, fg->wlen * sizeof(tre_char_t)); fg->wpattern[fg->wlen] = TRE_CHAR('\0'); -#ifdef TRE_WCHAR - STORE_MBS_PAT; -#endif /* Look for ways to cheat...er...avoid the full regex engine. */ for (unsigned int i = 0; i < fg->wlen; i++) { @@ -287,16 +284,16 @@ tre_fastcomp(fastmatch_t *fg, const tre_ } } else { /* Free memory and let others know this is empty. */ -#ifdef TRE_WCHAR - free(fg->pattern); - fg->pattern = NULL; -#endif free(fg->wpattern); fg->wpattern = NULL; return REG_BADPAT; } } +#ifdef TRE_WCHAR + STORE_MBS_PAT; +#endif + /* * Determine if a reverse search would be faster based on the placement * of the dots.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107260106.p6Q16itP084643>