aboutsummaryrefslogtreecommitdiff
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
parent0adec3643e5049601978f43705cf42f54ecbc18a (diff)
fixed regex match when using Oniguruma.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3495 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog7
-rw-r--r--libsylph/filter.c5
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b737e1c5..139b2e45 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
+2015-12-02
+
+ * libsylph/filter.c: strmatch_regex(): fixed regex match when using
+ Oniguruma (r3481 made it match only the head of searched string).
+
2015-11-27
- * version 3.5.0
+ * version 3.5.0rc
2015-11-27
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)