summarylogtreecommitdiffstats
path: root/isync-xdgconfig.diff
blob: 9ed3406cc64ac52629ff35d5db2ba1067916bb08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/src/config.c b/src/config.c
index 8ddfe26..537ae11 100644
--- a/src/config.c
+++ b/src/config.c
@@ -331,7 +331,12 @@ load_config( const char *where )
	char buf[1024];
 
 	if (!where) {
-		nfsnprintf( path, sizeof(path), "%s/." EXE "rc", Home );
+		char *configdir;
+		configdir = getenv("XDG_CONFIG_HOME");
+		if (configdir == NULL)
+			nfsnprintf( path, sizeof(path), "%s/.config/mbsync/" EXE "rc", Home );
+		else
+			nfsnprintf( path, sizeof(path), "%s/mbsync/" EXE "rc", configdir );
 		cfile.file = path;
 	} else
 		cfile.file = where;