]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/colors: ensure fallback to system directory
authorThomas Weißschuh <thomas@t-8ch.de>
Thu, 23 Feb 2023 02:20:28 +0000 (02:20 +0000)
committerThomas Weißschuh <thomas@t-8ch.de>
Thu, 23 Feb 2023 02:24:00 +0000 (02:24 +0000)
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 <thomas@t-8ch.de>
lib/colors.c

index 5f35392b9d99db4fa3ede85f8f5a6d756850fe8b..886dd81d70048aba98da51d5cd34b4ba0d1cefe4 100644 (file)
@@ -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);