# HG changeset patch # User ib # Date 1328885849 0 # Node ID 83f7a2f8af3ba17064475beb33a332a9c4072c5e # Parent ddf8f24a93a6d025d91ad66701f489b5c7dcbded Adjust content of GUI configuration file to MPlayer configuration files. Use option= 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.) diff -r ddf8f24a93a6 -r 83f7a2f8af3b gui/cfg.c --- 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); } } diff -r ddf8f24a93a6 -r 83f7a2f8af3b gui/win32/wincfg.c --- 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); } }