From: Thomas Weißschuh Date: Thu, 23 Feb 2023 02:20:28 +0000 (+0000) Subject: lib/colors: ensure fallback to system directory X-Git-Tag: v2.39-rc1~57 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4bdf22803f9a41329694e0c3c82189635dccdcd0;p=thirdparty%2Futil-linux.git lib/colors: ensure fallback to system directory The return value from colors_readdir(homedir) is used to determine if the system directory should be searched. Previously the mere existence of `~/.config/terminal-colors.d/` would inhibit all lookups in `/etc/terminal-colors.d`. Signed-off-by: Thomas Weißschuh --- diff --git a/lib/colors.c b/lib/colors.c index 5f35392b9d..886dd81d70 100644 --- a/lib/colors.c +++ b/lib/colors.c @@ -318,6 +318,8 @@ static int colors_readdir(struct ul_color_ctl *cc, const char *dirname) sfile[sizeof(sfile) - 1] = '\0'; if (asprintf(&cc->sfile, "%s/%s", dirname, sfile) <= 0) rc = -ENOMEM; + } else { + rc = -ENOENT; } closedir(dir);