diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2016-01-18 09:43:04 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2016-01-18 09:43:04 +0000 |
commit | f6b65c6fd3997d8d1e087d4918c68e2eb585f07c (patch) | |
tree | b9f73ab0100f12b084021b9bab63af59b687f2e4 | |
parent | adbdd017d532b5548190a815041bed5e5a60ed2f (diff) |
fixed Oniguruma regex match again.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3504 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | libsylph/filter.c | 8 |
2 files changed, 13 insertions, 2 deletions
@@ -1,3 +1,10 @@ +2016-01-18 + + * libsylph/filter.c: strmatch_regex(): removed ONIG_OPTION_EXTEND + option which requires spaces to be escaped. + This reverts the behavior of regex filtering to the original one + when using Oniguruma. + 2015-12-21 * libsylph/ssl.c: ssl_init(): enabled TLSv1.1 and TLSv1.2 for diff --git a/libsylph/filter.c b/libsylph/filter.c index 1a3bb4ae..c58f8fc9 100644 --- a/libsylph/filter.c +++ b/libsylph/filter.c @@ -344,11 +344,15 @@ static gboolean strmatch_regex(const gchar *haystack, const gchar *needle) size_t haystack_len; ret = onig_new(®, ptn, ptn + strlen(needle), - ONIG_OPTION_IGNORECASE|ONIG_OPTION_EXTEND, + /* ONIG_OPTION_EXTEND requires spaces to be escaped */ + /* ONIG_OPTION_IGNORECASE|ONIG_OPTION_EXTEND, */ + ONIG_OPTION_IGNORECASE, ONIG_ENCODING_UTF8, ONIG_SYNTAX_POSIX_EXTENDED, &err_info); - if (ret != ONIG_NORMAL) + if (ret != ONIG_NORMAL) { + g_warning("strmatch_regex: onig_new() failed: %d", ret); return FALSE; + } haystack_len = strlen(haystack); ret = onig_search(reg, str, str + haystack_len, |