]> git.sesse.net Git - vlc/commitdiff
* small fix for the config file. The parser assumes that the config file is
authorGildas Bazin <gbazin@videolan.org>
Sun, 17 Mar 2002 11:12:08 +0000 (11:12 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 17 Mar 2002 11:12:08 +0000 (11:12 +0000)
divided into sections (a section is the config data for a plugin and begins
with something like [foo]), so the comment for the beginning of the section
must be after the section marker and not before.

If you want to illustrate the problem (without this fix):
- save vlc's config
- exit from vlc and remove for example the dsp plugin (rm plugins/dsp.so)
- resave vlc's config
and now look at the end of the config file, it's all screwed up.

src/misc/configuration.c

index cf1e0ff74d439924bebfd68534d43e68f805e3ae..e18844896cdf23334558a234e5004701bba3ed01 100644 (file)
@@ -2,7 +2,7 @@
  * configuration.c management of the modules configuration
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: configuration.c,v 1.5 2002/03/16 23:03:19 sam Exp $
+ * $Id: configuration.c,v 1.6 2002/03/17 11:12:08 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -578,11 +578,11 @@ int config_SaveConfigFile( const char *psz_module_name )
         intf_WarnMsg( 5, "config: saving config for module <%s>",
                          p_module->psz_name );
 
+        fprintf( file, "[%s]\n", p_module->psz_name );
+
         if( p_module->psz_longname )
             fprintf( file, "###\n###  %s\n###\n", p_module->psz_longname );
 
-        fprintf( file, "[%s]\n", p_module->psz_name );
-
         for( i = 0; i < p_module->i_config_lines; i++ )
         {
             if( p_module->p_config[i].i_type & MODULE_CONFIG_HINT )