From de643df06780d49639809f922e29e11937798dc1 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Fri, 28 Aug 2015 09:38:45 +0300 Subject: [PATCH] All configuration parameters now support multi-line style. --- server/core/config.c | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/server/core/config.c b/server/core/config.c index 00ba5f93f..b8569ed2c 100644 --- a/server/core/config.c +++ b/server/core/config.c @@ -174,35 +174,18 @@ CONFIG_PARAMETER *param, *p1; { if (!strcmp(p1->name, name)) { - if(strcmp(name,"router_options") == 0 || strcmp(name,"options")) - { - char* tmp; + char* tmp; - if((tmp = malloc(sizeof(char) * (strlen(p1->value) + strlen(value) + 2))) == NULL) - { - skygw_log_write(LE,"[%s] Error: Memory allocation failed.",__FUNCTION__); - return 0; - } - strcpy(tmp,p1->value); - strcat(tmp,value); - free(p1->value); - p1->value = tmp; - if(p1->qfd_param_type == STRING_TYPE && p1->qfd.valstr != NULL) - { - free(p1->qfd.valstr); - p1->qfd.valstr = strdup(p1->value); - } - return 1; - } - else + if((tmp = malloc(sizeof(char) * (strlen(p1->value) + strlen(value) + 2))) == NULL) { - LOGIF(LE, (skygw_log_write_flush( - LOGFILE_ERROR, - "Error : Configuration object '%s' has multiple " - "parameters names '%s'.", - ptr->object, name))); - return 0; + skygw_log_write(LE,"[%s] Error: Memory allocation failed.",__FUNCTION__); + return 0; } + strcpy(tmp,p1->value); + strcat(tmp,value); + free(p1->value); + p1->value = tmp; + return 1; } p1 = p1->next; }