summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2014-10-22 16:36:55 +0200
committerKarel Zak <kzak@redhat.com>2014-10-24 11:10:06 +0200
commit3554620210c6d844f361d58649c18f7188130545 (patch)
tree8331a2daaa95cfa4d45d30469c3c8071c0b0c7d4
parenta77865e11572cca981aed683a401f1f09981f3ee (diff)
downloadutil-linux-3554620210c6d844f361d58649c18f7188130545.tar.gz
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>
-rw-r--r--lib/colors.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/colors.c b/lib/colors.c
index 8de1d2fbe..c333d239d 100644
--- a/lib/colors.c
+++ b/lib/colors.c
@@ -177,7 +177,6 @@ static void colors_debug(struct ul_color_ctl *cc)
}
fputc('\n', stdout);
}
-
#endif
/*
@@ -282,8 +281,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 ||