changeset 34593:83f7a2f8af3b

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.)
author ib
date Fri, 10 Feb 2012 14:57:29 +0000
parents ddf8f24a93a6
children c20ac9b80ea5
files gui/cfg.c gui/win32/wincfg.c
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gui/cfg.c	Fri Feb 10 14:13:14 2012 +0000
+++ b/gui/cfg.c	Fri Feb 10 14:57:29 2012 +0000
@@ -370,7 +370,12 @@
             }
 
             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);
             }
         }
--- a/gui/win32/wincfg.c	Fri Feb 10 14:13:14 2012 +0000
+++ b/gui/win32/wincfg.c	Fri Feb 10 14:57:29 2012 +0000
@@ -128,7 +128,11 @@
             }
             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);
             }
         }