From 8219c364884c5cca7db1253cc676f407eab684c6 Mon Sep 17 00:00:00 2001 From: John D Pell Date: Sun, 8 Aug 2021 09:36:19 +0200 Subject: [PATCH] WINGs: Use the constants added in config-paths.h for paths Replace hard-coded directory names by the constants that have been previously added to the common header. --- WINGs/userdefaults.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/WINGs/userdefaults.c b/WINGs/userdefaults.c index ea4ad3c4..76d3b30e 100644 --- a/WINGs/userdefaults.c +++ b/WINGs/userdefaults.c @@ -40,7 +40,6 @@ char *WMUserDefaultsDidChangeNotification = "WMUserDefaultsDidChangeNotification static void synchronizeUserDefaults(void *foo); -#define DEFAULTS_DIR "/Defaults" #ifndef HAVE_INOTIFY /* Check defaults database for changes every this many milliseconds */ /* XXX: this is shared with src/ stuff, put it in some common header */ @@ -49,7 +48,7 @@ static void synchronizeUserDefaults(void *foo); const char *wusergnusteppath() { - static const char subdir[] = "/GNUstep"; + static const char subdir[] = "/" GSUSER_SUBDIR; static char *path = NULL; char *gspath; const char *h; @@ -101,12 +100,11 @@ char *wdefaultspathfordomain(const char *domain) size_t slen; gspath = wusergnusteppath(); - slen = strlen(gspath) + strlen(DEFAULTS_DIR) + strlen(domain) + 4; + slen = strlen(gspath) + strlen("/" DEFAULTS_SUBDIR "/") + strlen(domain) + 1; path = wmalloc(slen); strcpy(path, gspath); - strcat(path, DEFAULTS_DIR); - strcat(path, "/"); + strcat(path, "/" DEFAULTS_SUBDIR "/"); strcat(path, domain); return path;