From 87b732846388d3c4a2d755863df4328a6c08041e Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Wed, 7 Aug 2013 16:08:48 +0200 Subject: CommandLine.cxx: look for config file in XDG_CONFIG_HOME too Look for "$XDG_CONFIG_HOME/mpd/mpd.conf", similar to where mpd looks for the file under Windows. --- src/CommandLine.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/CommandLine.cxx b/src/CommandLine.cxx index a62ea370e..89575a13f 100644 --- a/src/CommandLine.cxx +++ b/src/CommandLine.cxx @@ -54,6 +54,7 @@ #else /* G_OS_WIN32 */ #define USER_CONFIG_FILE_LOCATION1 ".mpdconf" #define USER_CONFIG_FILE_LOCATION2 ".mpd/mpd.conf" +#define USER_CONFIG_FILE_LOCATION_XDG "mpd/mpd.conf" #endif static GQuark @@ -219,7 +220,12 @@ parse_cmdline(int argc, char **argv, struct options *options, return ReadConfigFile(path, error_r); } #else /* G_OS_WIN32 */ - Path path = PathBuildChecked(Path::FromUTF8(g_get_home_dir()), + Path path = PathBuildChecked(Path::FromUTF8(g_get_user_config_dir()), + USER_CONFIG_FILE_LOCATION_XDG); + if (!path.IsNull() && FileExists(path)) + return ReadConfigFile(path, error_r); + + path = PathBuildChecked(Path::FromUTF8(g_get_home_dir()), USER_CONFIG_FILE_LOCATION1); if (!path.IsNull() && FileExists(path)) return ReadConfigFile(path, error_r); -- cgit v1.2.3