summaryrefslogtreecommitdiff
path: root/src/snuffleupagus.c
diff options
context:
space:
mode:
authorblotus2017-10-20 11:23:18 +0200
committerjvoisin2017-10-20 11:23:18 +0200
commit48df50444fe449c3ba0cb7ded2ed7bf76e57a435 (patch)
tree23e98167a3e7c43bd28fa76075fb39eddfa4e202 /src/snuffleupagus.c
parentba960050310c4ecd57157b1a0439c51b24c91520 (diff)
Add support for multiple files in sp.configuration_file directive
This should close (#45
Diffstat (limited to 'src/snuffleupagus.c')
-rw-r--r--src/snuffleupagus.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/snuffleupagus.c b/src/snuffleupagus.c
index 4f02065..01bc4f6 100644
--- a/src/snuffleupagus.c
+++ b/src/snuffleupagus.c
@@ -154,13 +154,21 @@ PHP_MINFO_FUNCTION(snuffleupagus) {
154static PHP_INI_MH(OnUpdateConfiguration) { 154static PHP_INI_MH(OnUpdateConfiguration) {
155 TSRMLS_FETCH(); 155 TSRMLS_FETCH();
156 156
157 char *config_file = NULL;
158
157 if (!new_value || !new_value->len) { 159 if (!new_value || !new_value->len) {
158 return FAILURE; 160 return FAILURE;
159 } 161 }
160 162
161 if (sp_parse_config(new_value->val) != SUCCESS) { 163 config_file = strtok(new_value->val, ",");
164 if (sp_parse_config(config_file) != SUCCESS) {
162 return FAILURE; 165 return FAILURE;
163 } 166 }
167 while ((config_file = strtok(NULL, ","))) {
168 if (sp_parse_config(config_file) != SUCCESS) {
169 return FAILURE;
170 }
171 }
164 172
165 if (SNUFFLEUPAGUS_G(config).config_random->enable) { 173 if (SNUFFLEUPAGUS_G(config).config_random->enable) {
166 hook_rand(); 174 hook_rand();