summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2016-02-07 12:10:14 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2016-04-06 21:25:24 +0100
commitf322340bc278be97bc93a4f8be5a8fd9e913304e (patch)
tree0cbfbc02f321fc44cccac6fe7a292e08b29577c9 /src
parent9094b84b4cce2eb862394b752eda93124d96d655 (diff)
Avoid RE compile unneeded unless LOOKUP_MODULE_DIR defined
Diffstat (limited to 'src')
-rw-r--r--src/src/drtables.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/src/drtables.c b/src/src/drtables.c
index d07123453..c83012944 100644
--- a/src/src/drtables.c
+++ b/src/src/drtables.c
@@ -524,8 +524,6 @@ init_lookup_list(void)
int moduleerrors = 0;
#endif
struct lookupmodulestr *p;
- const pcre *regex_islookupmod = regex_must_compile(
- US"\\." DYNLIB_FN_EXT "$", FALSE, TRUE);
if (lookup_list_init_done)
return;
@@ -610,6 +608,9 @@ init_lookup_list(void)
log_write(0, LOG_MAIN, "Couldn't open %s: not loading lookup modules\n", LOOKUP_MODULE_DIR);
}
else {
+ const pcre *regex_islookupmod = regex_must_compile(
+ US"\\." DYNLIB_FN_EXT "$", FALSE, TRUE);
+
DEBUG(D_lookup) debug_printf("Loading lookup modules from %s\n", LOOKUP_MODULE_DIR);
while ((ent = readdir(dd)) != NULL) {
char *name = ent->d_name;
@@ -666,14 +667,13 @@ init_lookup_list(void)
countmodules++;
}
}
+ store_free((void*)regex_islookupmod);
closedir(dd);
}
DEBUG(D_lookup) debug_printf("Loaded %d lookup modules\n", countmodules);
#endif
- store_free((void*)regex_islookupmod);
-
DEBUG(D_lookup) debug_printf("Total %d lookups\n", lookup_list_count);
lookup_list = store_malloc(sizeof(lookup_info *) * lookup_list_count);