- freez(config->actions_file);
- config->actions_file = make_path(config->confdir, arg);
+ i = 0;
+ while ((i < MAX_ACTION_FILES) && (NULL != config->actions_file[i]))
+ {
+ i++;
+ }
+
+ if (i >= MAX_ACTION_FILES)
+ {
+ log_error(LOG_LEVEL_FATAL, "Too many 'actionsfile' directives in config file - limit is %d.\n"
+ "(You can increase this limit by changing MAX_ACTION_FILES in project.h and recompiling).",
+ MAX_ACTION_FILES);
+ }
+ config->actions_file_short[i] = strdup(arg);
+ p = malloc(strlen(arg) + sizeof(".action"));
+ if (p == NULL)
+ {
+ log_error(LOG_LEVEL_FATAL, "Out of memory");
+ }
+ strcpy(p, arg);
+ strcat(p, ".action");
+ config->actions_file[i] = make_path(config->confdir, p);
+ free(p);