summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarel Zak2014-10-22 16:36:55 +0200
committerKarel Zak2014-10-22 16:36:55 +0200
commiteb728f96aaab659f30b240eccf98ebb175208b30 (patch)
tree4b346eaf32585d7c1f65768a989f974cf5fa2df3 /lib
parentdocs: update TODO file (diff)
downloadkernel-qcow2-util-linux-eb728f96aaab659f30b240eccf98ebb175208b30.tar.gz
kernel-qcow2-util-linux-eb728f96aaab659f30b240eccf98ebb175208b30.tar.xz
kernel-qcow2-util-linux-eb728f96aaab659f30b240eccf98ebb175208b30.zip
terminal-colors.d: fix filter by name
Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=766077 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/colors.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/colors.c b/lib/colors.c
index 7349063d0..7b16a15b7 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 ||