From c7a15ed0ddf56b80a962a6aeb5da7981472ceaf2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 2 Aug 2012 02:26:55 +0200 Subject: m_config: reallow specifying static default values for string options Commit dc2a4863af9b0e introduced a new way of specifying default values for strings (you're supposed to use OPTDEF_STR() instead of putting it into the option struct, such as it was done in defaultopts.c). The code to handle the old way was explicitly disabled, which caused random crashes when used. Allow the old way again. With the main option struct in particular, I see no reason why some option defaults should be specified in defaultopts.c, and some directly along the options. --- m_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m_config.c b/m_config.c index 5b8dc77ba7..8181ddac37 100644 --- a/m_config.c +++ b/m_config.c @@ -333,7 +333,7 @@ static void m_config_add_option(struct m_config *config, // Target data in optstruct is supposed to be cleared (consider // m_option freeing previously set dynamic data). optstruct_set(config, arg, arg->defval); - } else if (!arg->new && (arg->type->flags & M_OPT_TYPE_DYNAMIC)) { + } else if (arg->type->flags & M_OPT_TYPE_DYNAMIC) { // Initialize dynamically managed fields from static data (like // string options): copy the option into temporary memory, // clear the original option (to void m_option freeing the -- cgit v1.2.3