diff --git a/src/ls.c b/src/ls.c
index 83fac90..758a000 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -3976,9 +3976,9 @@ print_color_indicator (const char *name, mode_t mode, int linkok,
 	}
     }
 
-  /* Check the file's suffix only if still classified as C_FILE.  */
+  /* Check the file's suffix if it is still classified as C_FILE or D_DIR */
   ext = NULL;
-  if (type == C_FILE)
+  if (type == C_FILE || type == C_DIR)
     {
       /* Test if NAME has a recognized suffix.  */
 
@@ -3986,9 +3986,16 @@ print_color_indicator (const char *name, mode_t mode, int linkok,
       name += len;		/* Pointer to final \0.  */
       for (ext = color_ext_list; ext != NULL; ext = ext->next)
 	{
+	/* match files exactly, and directories against extentions with a */
+	/* final / (ignoring the / itself) */
 	  if (ext->ext.len <= len
-	      && strncmp (name - ext->ext.len, ext->ext.string,
+	      && ((C_FILE == type
+		   && strncmp (name - ext->ext.len, ext->ext.string,
 			  ext->ext.len) == 0)
+		|| (C_DIR == type
+		   && '/' == ext->ext.string[ext->ext.len - 1]
+		   && strncmp (name - ext->ext.len + 1, ext->ext.string, ext->ext.len - 1) 
+		     == 0)))
 	    break;
 	}
     }
