aboutsummaryrefslogtreecommitdiff
path: root/libsylph
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2015-12-02 08:55:32 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2015-12-02 08:55:32 +0000
commitef09072e34def09f0fa60662493e29f6aa22666d (patch)
tree56725c2d834d42fe7e71fcfcb9a6524444191b52 /libsylph
parent0adec3643e5049601978f43705cf42f54ecbc18a (diff)
fixed regex match when using Oniguruma.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3495 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r--libsylph/filter.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libsylph/filter.c b/libsylph/filter.c
index 873e32df..1a3bb4ae 100644
--- a/libsylph/filter.c
+++ b/libsylph/filter.c
@@ -341,6 +341,7 @@ static gboolean strmatch_regex(const gchar *haystack, const gchar *needle)
OnigErrorInfo err_info;
const UChar *ptn = (const UChar *)needle;
const UChar *str = (const UChar *)haystack;
+ size_t haystack_len;
ret = onig_new(&reg, ptn, ptn + strlen(needle),
ONIG_OPTION_IGNORECASE|ONIG_OPTION_EXTEND,
@@ -349,7 +350,9 @@ static gboolean strmatch_regex(const gchar *haystack, const gchar *needle)
if (ret != ONIG_NORMAL)
return FALSE;
- ret = onig_match(reg, str, str + strlen(haystack), str, NULL, 0);
+ haystack_len = strlen(haystack);
+ ret = onig_search(reg, str, str + haystack_len,
+ str, str + haystack_len, NULL, 0);
onig_free(reg);
if (ret >= 0)