Suggestion from https://github.com/coreutils/coreutils/pull/14
This has irked me also a few times, and I don't see a need to make this 
conditional.
Attached is a proposed solution.

cheers,
Pádraig
>From 7fb5c7e9de3a02d89e3bf1c2579e4c347e2cca4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]>
Date: Sat, 16 Jun 2018 20:45:33 -0700
Subject: [PATCH] ls: ignore case when coloring file extensions

* src/ls.c (get_color_indicator): s/STREQ_LEN/c_strncasecmp/
---
 src/ls.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/ls.c b/src/ls.c
index bae2c11..bf0c594 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -86,6 +86,7 @@
 
 #include "acl.h"
 #include "argmatch.h"
+#include "c-strcase.h"
 #include "dev-ino.h"
 #include "die.h"
 #include "error.h"
@@ -4766,8 +4767,8 @@ get_color_indicator (const struct fileinfo *f, bool symlink_target)
       for (ext = color_ext_list; ext != NULL; ext = ext->next)
         {
           if (ext->ext.len <= len
-              && STREQ_LEN (name - ext->ext.len, ext->ext.string,
-                            ext->ext.len))
+              && c_strncasecmp (name - ext->ext.len, ext->ext.string,
+                                ext->ext.len) == 0)
             break;
         }
     }
-- 
2.9.3

Reply via email to