summaryrefslogtreecommitdiff
path: root/nick.c
diff options
context:
space:
mode:
Diffstat (limited to 'nick.c')
-rw-r--r--nick.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/nick.c b/nick.c
index 54a0b2f..181a3a1 100644
--- a/nick.c
+++ b/nick.c
@@ -6,9 +6,11 @@
#include "nick.h"
struct nick_t *nicks;
+const unsigned char *nick_pcre_tables;
void nick_init() {
nicks = NULL;
+ nick_pcre_tables = pcre_maketables();
}
struct nick_t *nick_add(const char *name) {
@@ -43,7 +45,7 @@ int nick_regex_add(struct nick_t *nick, const char *re_s) {
const char *error;
int erroffset;
- nre->re = pcre_compile(re_s, 0, &error, &erroffset, NULL);
+ nre->re = pcre_compile(re_s, 0, &error, &erroffset, nick_pcre_tables);
if(!nre->re) {
/* Copied from re_error in regexset.c */
fprintf(stderr, "Nick RE failed to compile: %s\n", error);
@@ -102,4 +104,5 @@ void nick_free() {
nick = next;
}
free(nicks);
+ pcre_free((void*)nick_pcre_tables);
}