]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
terminal-colors.d: fix filter by name
authorKarel Zak <kzak@redhat.com>
Wed, 22 Oct 2014 14:36:55 +0000 (16:36 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 22 Oct 2014 14:36:55 +0000 (16:36 +0200)
Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=766077
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/colors.c

index 7349063d017c2bfc3e25a363e47059cb1f9e280e..7b16a15b725bb5140eb0f39b779dbb1a0f967076 100644 (file)
@@ -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 ||