From: Karel Zak Date: Wed, 22 Oct 2014 14:36:55 +0000 (+0200) Subject: terminal-colors.d: fix filter by name X-Git-Tag: v2.26-rc1~286 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb728f96aaab659f30b240eccf98ebb175208b30;p=thirdparty%2Futil-linux.git terminal-colors.d: fix filter by name Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=766077 Signed-off-by: Karel Zak --- 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 ||