summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2009-08-21 12:24:40 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2009-08-21 12:24:40 +0200
commit431296aedecf7a05cd3332e885fc56b784ef00cb (patch)
treed0ee039f8bd6dee0fa06473a294f0d375dd9f0eb
parentac09b4627a15c61fe6e088e6c4bce9b1778cded4 (diff)
Study the nick pcre patterns.
-rw-r--r--nick.c3
-rw-r--r--nick.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/nick.c b/nick.c
index 486f4fb..8b336de 100644
--- a/nick.c
+++ b/nick.c
@@ -53,6 +53,7 @@ int nick_regex_add(struct nick_t *nick, const char *re_s) {
free(nre);
return 0;
}
+ nre->re_e = pcre_study(nre->re, 0, &error);
nre->next = NULL;
@@ -73,6 +74,8 @@ void nick_free() {
struct nick_regex_t *re = nick->regexes;
while(re) {
pcre_free(re->re);
+ if(re->re_e)
+ pcre_free(re->re_e);
struct nick_regex_t *next = re->next;
free(re);
re = next;
diff --git a/nick.h b/nick.h
index 7e65fc3..580ebf1 100644
--- a/nick.h
+++ b/nick.h
@@ -7,6 +7,7 @@ struct nick_t {
char *name;
struct nick_regex_t {
pcre *re;
+ pcre_extra *re_e;
struct nick_regex_t *next;
} *regexes;
struct nick_t *next;