1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 12:00:31 +01:00

WINGs: Simplify wglobaldefaultspathfordomain

The original code was over-complicated, it can be reduced to a one-line
call to a function that does the same thing, with the bonus that it will
behave better in the case where domain == NULL.
This commit is contained in:
Christophe CURIS
2021-08-08 09:36:31 +02:00
committed by Carlos R. Mafra
parent 26491867a3
commit ca4ae5068b

View File

@@ -113,14 +113,7 @@ char *wdefaultspathfordomain(const char *domain)
/* XXX: doesn't quite belong to *user*defaults.c */
char *wglobaldefaultspathfordomain(const char *domain)
{
char *t = NULL;
size_t len;
len = strlen(PKGCONFDIR) + strlen(domain) + 2;
t = wmalloc(len);
snprintf(t, len, "%s/%s", PKGCONFDIR, domain);
return t;
return wstrconcat(PKGCONFDIR "/", domain);
}
void w_save_defaults_changes(void)