Commit 2867bb65 authored by Gildas Bazin's avatar Gildas Bazin

* modified the gtk interface to save an empty <string> option as a NULL pointer
* modified config_LoadConfigFile to consider an empty <string> option as a
   NULL pointer.
parent 09b7f775
......@@ -2,9 +2,10 @@
* gtk_preferences.c: functions to handle the preferences dialog box.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_preferences.c,v 1.17 2002/03/26 17:33:37 lool Exp $
* $Id: gtk_preferences.c,v 1.18 2002/03/26 22:30:09 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Loc Minier <lool@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -684,7 +685,8 @@ static void GtkSaveHashValue( gpointer key, gpointer value, gpointer user_data)
case MODULE_CONFIG_ITEM_STRING:
case MODULE_CONFIG_ITEM_FILE:
case MODULE_CONFIG_ITEM_PLUGIN:
config_PutPszVariable( p_config->psz_name, p_config->psz_value );
config_PutPszVariable( p_config->psz_name,
*p_config->psz_value? p_config->psz_value : NULL );
break;
case MODULE_CONFIG_ITEM_INTEGER:
case MODULE_CONFIG_ITEM_BOOL:
......
......@@ -2,7 +2,7 @@
* configuration.c management of the modules configuration
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: configuration.c,v 1.9 2002/03/26 22:02:32 gbazin Exp $
* $Id: configuration.c,v 1.10 2002/03/26 22:30:09 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -384,17 +384,14 @@ int config_LoadConfigFile( const char *psz_module_name )
break;
default:
if( !*psz_option_value )
break; /* ignore empty option */
vlc_mutex_lock( p_module->p_config[i].p_lock );
/* free old string */
if( p_module->p_config[i].psz_value )
free( p_module->p_config[i].psz_value );
p_module->p_config[i].psz_value =
strdup( psz_option_value );
p_module->p_config[i].psz_value = *psz_option_value ?
strdup( psz_option_value ) : NULL;
vlc_mutex_unlock( p_module->p_config[i].p_lock );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment