[MPlayer-cvslog] r34681 - in trunk/gui: cfg.c win32/wincfg.c

ib subversion at mplayerhq.hu
Fri Feb 10 15:57:29 CET 2012


Author: ib
Date: Fri Feb 10 15:57:29 2012
New Revision: 34681

Log:
Adjust content of GUI configuration file to MPlayer configuration files.

Use option=<value> without spaces and quote value only if necessary.

(The change of the output format is purely cosmetic, but shall make the
interested GUI user aware that defining options is basically the same
for MPlayer and the GUI.)

Modified:
   trunk/gui/cfg.c
   trunk/gui/win32/wincfg.c

Modified: trunk/gui/cfg.c
==============================================================================
--- trunk/gui/cfg.c	Fri Feb 10 15:13:14 2012	(r34680)
+++ trunk/gui/cfg.c	Fri Feb 10 15:57:29 2012	(r34681)
@@ -370,7 +370,12 @@ void cfg_write(void)
             }
 
             if (val) {
-                fprintf(file, "%s = \"%s\"\n", gui_opts[i].name, val);
+                char delim[] = { "\"" };
+
+                if (!strchr(val, ' '))
+                    *delim = 0;
+
+                fprintf(file, "%s=%s%s%s\n", gui_opts[i].name, delim, val, delim);
                 free(val);
             }
         }

Modified: trunk/gui/win32/wincfg.c
==============================================================================
--- trunk/gui/win32/wincfg.c	Fri Feb 10 15:13:14 2012	(r34680)
+++ trunk/gui/win32/wincfg.c	Fri Feb 10 15:57:29 2012	(r34681)
@@ -128,7 +128,11 @@ void cfg_write(void)
             }
             if(v)
             {
-                fprintf(f, "%s = \"%s\"\n", gui_opts[i].name, v);
+                char delim[] = {"\""};
+
+                if (!strchr(val, ' ')) *delim = 0;
+
+                fprintf(f, "%s=%s%s%s\n", gui_opts[i].name, v);
                 free(v);
             }
         }


More information about the MPlayer-cvslog mailing list