From: Florian Forster Date: Sat, 2 Dec 2006 16:51:58 +0000 (+0100) Subject: src/utils_ignorelist.c: Fix build-problems when building without regex support. X-Git-Tag: collectd-3.11.0~40 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=0b5b7d3f65c22163a1bf1a9f2ba55e3965e47151;p=collectd.git src/utils_ignorelist.c: Fix build-problems when building without regex support. --- diff --git a/src/utils_ignorelist.c b/src/utils_ignorelist.c index 27eb987c..532eb4b0 100644 --- a/src/utils_ignorelist.c +++ b/src/utils_ignorelist.c @@ -285,7 +285,6 @@ int ignorelist_add (ignorelist_t *il, const char *entry) { int ret; size_t entry_len; - char *entry_copy; if (il == NULL) { @@ -306,6 +305,8 @@ int ignorelist_add (ignorelist_t *il, const char *entry) /* regex string is enclosed in "/.../" */ if ((entry_len > 2) && (entry[0] == '/') && entry[entry_len - 1] == '/') { + char *entry_copy; + /* We need to copy `entry' since it's const */ entry_copy = smalloc (entry_len); memset (entry_copy, '\0', entry_len);