about summary refs log tree commit diff
path: root/xdg.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--xdg.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/xdg.c b/xdg.c
index 6e33210..ed2a6e1 100644
--- a/xdg.c
+++ b/xdg.c
@@ -24,6 +24,8 @@
 
 #include "chat.h"
 
+#define SUBDIR "catgirl"
+
 FILE *configOpen(const char *path, const char *mode) {
 	if (path[0] == '/' || path[0] == '.') goto local;
 
@@ -33,10 +35,10 @@ FILE *configOpen(const char *path, const char *mode) {
 
 	char buf[PATH_MAX];
 	if (configHome) {
-		snprintf(buf, sizeof(buf), "%s/" XDG_SUBDIR "/%s", configHome, path);
+		snprintf(buf, sizeof(buf), "%s/" SUBDIR "/%s", configHome, path);
 	} else {
 		if (!home) goto local;
-		snprintf(buf, sizeof(buf), "%s/.config/" XDG_SUBDIR "/%s", home, path);
+		snprintf(buf, sizeof(buf), "%s/.config/" SUBDIR "/%s", home, path);
 	}
 	FILE *file = fopen(buf, mode);
 	if (file) return file;
@@ -49,7 +51,7 @@ FILE *configOpen(const char *path, const char *mode) {
 	while (*configDirs) {
 		size_t len = strcspn(configDirs, ":");
 		snprintf(
-			buf, sizeof(buf), "%.*s/" XDG_SUBDIR "/%s",
+			buf, sizeof(buf), "%.*s/" SUBDIR "/%s",
 			(int)len, configDirs, path
 		);
 		file = fopen(buf, mode);
@@ -79,13 +81,13 @@ FILE *dataOpen(const char *path, const char *mode) {
 	if (dataHome) {
 		snprintf(
 			homePath, sizeof(homePath),
-			"%s/" XDG_SUBDIR "/%s", dataHome, path
+			"%s/" SUBDIR "/%s", dataHome, path
 		);
 	} else {
 		if (!home) goto local;
 		snprintf(
 			homePath, sizeof(homePath),
-			"%s/.local/share/" XDG_SUBDIR "/%s", home, path
+			"%s/.local/share/" SUBDIR "/%s", home, path
 		);
 	}
 	FILE *file = fopen(homePath, mode);
@@ -100,7 +102,7 @@ FILE *dataOpen(const char *path, const char *mode) {
 	while (*dataDirs) {
 		size_t len = strcspn(dataDirs, ":");
 		snprintf(
-			buf, sizeof(buf), "%.*s/" XDG_SUBDIR "/%s",
+			buf, sizeof(buf), "%.*s/" SUBDIR "/%s",
 			(int)len, dataDirs, path
 		);
 		file = fopen(buf, mode);
e1&follow=1'>Add House of LeavesJune McEnroe 2018-04-03Add ChromaticsJune McEnroe 2018-04-03Add those new Arcade Fire singlesJune McEnroe 2018-04-03Add SermonJune McEnroe 2018-04-03Add Pools of LightJune McEnroe 2018-04-03Add SteroidsJune McEnroe 2018-04-03Add A Common TruthJune McEnroe 2018-04-03Add new Colin Stetson albumJune McEnroe 2018-04-03Add ForgetJune McEnroe 2018-04-03Add ArcaJune McEnroe 2018-04-03Add new DMST and Joni VoidJune McEnroe 2018-04-03Add The Body LoversJune McEnroe 2018-04-03Add some albums from recentlyJune McEnroe 2018-04-03Add Saltland Light of MercyJune McEnroe 2018-04-03Add Jessica Moss GlaciersJune McEnroe 2018-04-03Add BNNY RBBTJune McEnroe 2018-04-03Add DepthsJune McEnroe 2018-04-03Add new Saltland previewJune McEnroe 2018-04-03Add BenjiJune McEnroe 2018-04-03Add Mouth MoodsJune McEnroe 2018-04-03Add Those Who Walk AwayJune McEnroe 2018-04-03Add Some TunesJune McEnroe 2018-04-03Add Pas pire popJune McEnroe 2018-04-03Add I Give You PowerJune McEnroe 2018-04-03Add Jenny GoGoJune McEnroe 2018-04-03Add KKB Fish BowlJune McEnroe 2018-04-03Add new Avec le soleil album previewJune McEnroe 2018-04-03Add Julien Baker as recent new musicJune McEnroe 2018-04-03Add recent new musicJune McEnroe