summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--chat.h2
-rw-r--r--xdg.c14
2 files changed, 8 insertions, 8 deletions
diff --git a/chat.h b/chat.h
index 829dd1d..735327d 100644
--- a/chat.h
+++ b/chat.h
@@ -26,8 +26,6 @@
 #define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0]))
 #define BIT(x) x##Bit, x = 1 << x##Bit, x##Bit_ = x##Bit
 
-#define XDG_SUBDIR "catgirl"
-
 typedef unsigned char byte;
 
 int procPipe[2];
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);
c372152c1046caf20703057347cebc5d5f0&follow=1'>Add htagml -iJune McEnroe 2021-01-12Render tag index in HTMLJune McEnroe 2021-01-12Add htagml -xJune McEnroe 2021-01-12Prevent matching the same tag twiceJune McEnroe 2021-01-12Process htagml file line by lineJune McEnroe 2021-01-12Split fields by tab onlyJune McEnroe 2021-01-12List both Makefile and html.sh under README.7June McEnroe 2021-01-12Add htagml exampleJune McEnroe 2021-01-12Use mandoc and htagml for bin htmlJune McEnroe 2021-01-12Add htagmlJune McEnroe 2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe 2021-01-11Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe 2021-01-09Add c -t flag to print expression typeJune McEnroe 2021-01-05Update taglineJune McEnroe