]> git.sesse.net Git - vlc/commitdiff
Fix saving of strings config variables. Patch courtesy of Andrew Zaikin
authorChristophe Mutricy <xtophe@videolan.org>
Sun, 13 Jan 2008 22:43:05 +0000 (22:43 +0000)
committerChristophe Mutricy <xtophe@videolan.org>
Sun, 13 Jan 2008 22:43:05 +0000 (22:43 +0000)
THANKS
src/config/file.c

diff --git a/THANKS b/THANKS
index a93561ef4267ba5bf96618c3a1d279ed590f2ae1..491c62022acfa9071d28a5627c2a0d8937985307 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -21,6 +21,7 @@ AndrĂ© de Barros Martins Ribeiro <andrerib at ajato.com.br> - Brazilian portugue
 Andre Pang <adre.pang at csiro dot au> - Annodex support
 Andre Weber <WeberAndre at gmx d0t de> - Qt4 patches
 Andres Krapf <dae at via.ecp.fr> - FreeBSD port and tests, KDE interface
+Andrew Zaikin <andrew dot zaikin at gmail dot com> - Config saving fixes
 Andrey Brilevskiy <director at macwest.ru> - Russian translation
 Andy Lindsay <andy_vl at ananam.com> - fixes in the TS demux
 Arkadiusz Lipiec <A.Lipiec at elka.pw.edu.pl> - Polish translation
index 137e1251b0a7abb8ebdeebeddf80f9c4c2fd6bf4..89f8de138ce44c5de0fa1161211c9010ce076483 100644 (file)
@@ -595,19 +595,20 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
                         : (p_item->orig.psz != NULL);
 
                 config_Write (file, p_item->psz_text, N_("string"),
-                              modified, p_item->psz_name, "%s",
+                              !modified, p_item->psz_name, "%s",
                               psz_value ? psz_value : "");
 
-                if (b_retain)
-                    break;
+                if ( !b_retain )
+                {
 
-                free ((char *)p_item->saved.psz);
-                if( (psz_value && p_item->orig.psz &&
-                     strcmp( psz_value, p_item->orig.psz )) ||
-                    !psz_value || !p_item->orig.psz)
-                    p_item->saved.psz = strdupnull (psz_value);
-                else
-                    p_item->saved.psz = NULL;
+                    free ((char *)p_item->saved.psz);
+                    if( (psz_value && p_item->orig.psz &&
+                         strcmp( psz_value, p_item->orig.psz )) ||
+                        !psz_value || !p_item->orig.psz)
+                        p_item->saved.psz = strdupnull (psz_value);
+                    else
+                        p_item->saved.psz = NULL;
+                }
             }
 
             if (!b_retain)