[MPlayer-dev-eng] Tiny patch to make ~/.mplayer overridable

Nikolai Weibull nikolai.weibull at gmail.com
Tue Oct 18 17:14:25 CEST 2005


The following patch against CVS allows the user to set the $MPLAYER_HOME
environment variable to point to a directory that mplayer should look
for configuration files in.  I would personally like this, as I like to
keep my ~ clean.  I guess one could also support the $XDG_CONFIG_HOME
environment variable as defined in
http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html, but
that's perhaps too tied to GNOME and KDE.

Index: get_path.c
===================================================================
RCS file: /cvsroot/mplayer/main/get_path.c,v
retrieving revision 1.11
diff -u -r1.11 get_path.c
--- get_path.c  16 Oct 2005 19:14:09 -0000      1.11
+++ get_path.c  18 Oct 2005 15:09:11 -0000
@@ -36,7 +36,9 @@
        char *bdl_url_path = NULL;
 #endif

-       if ((homedir = getenv("HOME")) == NULL)
+        if ((homedir = getenv("MPLAYER_HOME")) != NULL)
+                config_dir = "";
+        else if ((homedir = getenv("HOME")) == NULL)
 #if defined(__MINGW32__)||defined(__CYGWIN__) /*hack to get fonts
etc. loaded outside of cygwin environment*/
        {
         int i,imax=0;




More information about the MPlayer-dev-eng mailing list