From 3a269dca93c421141631b4c87b2f366b6c130a42 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 28 Nov 2013 14:40:54 -0200 Subject: Fixed conf inheritance issue Special Thanks to bgamez23, kyeme. Signed-off-by: shennetsind --- src/common/conf.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/common') diff --git a/src/common/conf.c b/src/common/conf.c index 6802f728b..a6329d70e 100644 --- a/src/common/conf.c +++ b/src/common/conf.c @@ -1,5 +1,6 @@ -// Copyright (c) Athena Dev Teams - Licensed under GNU GPL -// For more information, see LICENCE in the main folder +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. +// See the LICENSE file +// Portions Copyright (c) Athena Dev Teams #include "conf.h" #include "../../3rdparty/libconfig/libconfig.h" @@ -32,9 +33,12 @@ void config_setting_copy_simple(config_setting_t *parent, const config_setting_t config_setting_copy_aggregate(parent, src); } else { - config_setting_t *set = config_setting_add(parent, config_setting_name(src), config_setting_type(src)); - - if (set == NULL) + config_setting_t *set; + + if( config_setting_get_member(parent, config_setting_name(src)) != NULL ) + return; + + if ((set = config_setting_add(parent, config_setting_name(src), config_setting_type(src))) == NULL) return; if (CONFIG_TYPE_INT == config_setting_type(src)) { -- cgit v1.2.3-70-g09d2