diff --git a/bench_str.csv b/bench_str.csv index c4b7ce4..c0d4f60 100644 --- a/bench_str.csv +++ b/bench_str.csv @@ -456,3 +456,6 @@ 1400816448,9260790.48,2131479.91,55188.21 1400816458,9303957.38,2110797.39,55924.05 1400816525,9330370.85,1985782.06,59074.70 +1400816594,9389101.94,1989498.64,34663.67 +1400816645,9201251.49,2105517.01,43240.25 +1400816815,9228390.29,2097606.06,23301.69 diff --git a/src/node.c b/src/node.c index 5a6ad50..ddf1352 100644 --- a/src/node.c +++ b/src/node.c @@ -270,12 +270,12 @@ node * r3_tree_matchl(const node * n, char * path, int path_len, match_entry * e int ov[ ov_cnt ]; rc = pcre_exec( - n->pcre_pattern, /* the compiled pattern */ + n->pcre_pattern, /* the compiled pattern */ n->pcre_extra, - path, /* the subject string */ - path_len, /* the length of the subject */ - 0, /* start at offset 0 in the subject */ - 0, /* default options */ + path, /* the subject string */ + path_len, /* the length of the subject */ + 0, /* start at offset 0 in the subject */ + 0, /* default options */ ov, /* output vector for substring information */ ov_cnt); /* number of elements in the output vector */ @@ -283,11 +283,14 @@ node * r3_tree_matchl(const node * n, char * path, int path_len, match_entry * e if (rc < 0) { switch(rc) { - case PCRE_ERROR_NOMATCH: printf("pcre: no match\n"); break; - /* - Handle other special cases if you like - */ - default: printf("pcre matching error '%d' on pattern '%s'\n", rc, n->combined_pattern); break; + case PCRE_ERROR_NOMATCH: + printf("pcre: no match '%s' on pattern '%s'\n", path, n->combined_pattern); + break; + + // Handle other special cases if you like + default: + printf("pcre matching error '%d' '%s' on pattern '%s'\n", rc, path, n->combined_pattern); + break; } // does not match all edges, return NULL; return NULL; diff --git a/tests/check_tree.c b/tests/check_tree.c index 36885f2..a58192e 100644 --- a/tests/check_tree.c +++ b/tests/check_tree.c @@ -165,7 +165,6 @@ START_TEST (test_pcre_patterns_insert_3) matched = r3_tree_match(n, "/post/11", NULL); ck_assert(!matched); - matched = r3_tree_match(n, "/post/11/", NULL); ck_assert(!matched);