Subject: [PATCH] ls --color case insensitive extension matching

From: marcel partap <[email-masked]>
Date: Tue, 26 Jul 2011 22:33:43 +0200

Here's a patch. Adds STRCASEEQ_LEN macro for case insensitive extension 
matching.
#regards/marcel.
--- src/ls.c.orig	2011-04-12 12:07:43.000000000 +0200
+++ src/ls.c	2011-07-26 22:27:08.503523893 +0200
@@ -4209,7 +4209,7 @@
       for (ext = color_ext_list; ext != NULL; ext = ext->next)
         {
           if (ext->ext.len <= len
-              && STREQ_LEN (name - ext->ext.len, ext->ext.string,
+              && STRCASEEQ_LEN (name - ext->ext.len, ext->ext.string,
                             ext->ext.len))
             break;
         }
--- src/system.h.orig	2011-04-25 11:45:49.000000000 +0200
+++ src/system.h	2011-07-26 22:26:48.539795894 +0200
@@ -258,6 +258,7 @@
 
 #define STREQ(a, b) (strcmp (a, b) == 0)
 #define STREQ_LEN(a, b, n) (strncmp (a, b, n) == 0)
+#define STRCASEEQ_LEN(a, b, n) (strncasecmp (a, b, n) == 0)
 #define STRPREFIX(a, b) (strncmp(a, b, strlen (b)) == 0)
 
 /* Just like strncmp, but the first argument must be a literal string