svn commit: r224412 - user/gabor/tre-integration/contrib/tre/lib
Gabor Kovesdan
gabor at FreeBSD.org
Tue Jul 26 01:06:44 UTC 2011
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.
More information about the svn-src-user
mailing list