summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/filetypes.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/filetypes.c b/apps/filetypes.c
index 89933c8774..75c58cc752 100644
--- a/apps/filetypes.c
+++ b/apps/filetypes.c
@@ -126,7 +126,7 @@ static struct file_type filetypes[MAX_FILETYPES];
126static int custom_filetype_icons[MAX_FILETYPES]; 126static int custom_filetype_icons[MAX_FILETYPES];
127static bool custom_icons_loaded = false; 127static bool custom_icons_loaded = false;
128#ifdef HAVE_LCD_COLOR 128#ifdef HAVE_LCD_COLOR
129static int custom_colors[MAX_FILETYPES]; 129static int custom_colors[MAX_FILETYPES+1];
130#endif 130#endif
131static int filetype_count = 0; 131static int filetype_count = 0;
132static unsigned char heighest_attr = 0; 132static unsigned char heighest_attr = 0;
@@ -166,6 +166,11 @@ void read_color_theme_file(void) {
166 custom_colors[0] = hex_to_rgb(color); 166 custom_colors[0] = hex_to_rgb(color);
167 continue; 167 continue;
168 } 168 }
169 if (!strcasecmp(ext, "???"))
170 {
171 custom_colors[MAX_FILETYPES] = hex_to_rgb(color);
172 continue;
173 }
169 for (i=1; i<filetype_count; i++) 174 for (i=1; i<filetype_count; i++)
170 { 175 {
171 if (filetypes[i].extension && 176 if (filetypes[i].extension &&
@@ -383,7 +388,7 @@ int filetype_get_color(const char * name, int attr)
383 return custom_colors[0]; 388 return custom_colors[0];
384 extension = strrchr(name, '.'); 389 extension = strrchr(name, '.');
385 if (!extension) 390 if (!extension)
386 return -1; 391 return custom_colors[MAX_FILETYPES];
387 extension++; 392 extension++;
388 logf("%s %s",name,extension); 393 logf("%s %s",name,extension);
389 for (i=1; i<filetype_count; i++) 394 for (i=1; i<filetype_count; i++)
@@ -392,7 +397,7 @@ int filetype_get_color(const char * name, int attr)
392 !strcasecmp(extension, filetypes[i].extension)) 397 !strcasecmp(extension, filetypes[i].extension))
393 return custom_colors[i]; 398 return custom_colors[i];
394 } 399 }
395 return -1; 400 return custom_colors[MAX_FILETYPES];
396} 401}
397#endif 402#endif
398 403