From eb728f96aaab659f30b240eccf98ebb175208b30 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 22 Oct 2014 16:36:55 +0200 Subject: [PATCH] terminal-colors.d: fix filter by name Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=766077 Signed-off-by: Karel Zak --- lib/colors.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/colors.c b/lib/colors.c index 7349063d01..7b16a15b72 100644 --- a/lib/colors.c +++ b/lib/colors.c @@ -180,7 +180,6 @@ static void colors_debug(struct ul_color_ctl *cc) } fputc('\n', stdout); } - #endif /* @@ -285,8 +284,8 @@ static int colors_readdir(struct ul_color_ctl *cc, const char *dirname) continue; /* filter out by names */ - if (tk_namesz != namesz - || strncmp(tk_name, cc->utilname, namesz) != 0) + if (tk_namesz && (tk_namesz != namesz || + strncmp(tk_name, cc->utilname, namesz) != 0)) continue; if (tk_termsz && (termsz == 0 || tk_termsz != termsz || -- 2.47.3