summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Gjenero <boris.gjenero@gmail.com>2013-06-05 18:35:09 -0400
committerBoris Gjenero <boris.gjenero@gmail.com>2013-06-05 18:35:09 -0400
commit15fa7f866fe3a17afc9699f86e52aef7cb1a09d0 (patch)
tree2e73bb423aec0198f5645a8f4d00c80511df8a08
parent98c34d8723c949a7fcbc25ddf0e1c753008c982e (diff)
downloadrockbox-15fa7f8.tar.gz
rockbox-15fa7f8.tar.bz2
rockbox-15fa7f8.zip
Fix color of files with no extension.
Based on all other references, unknown_file.color is a color, not an index into custom_colors[]. Previously, custom_colors[-1] was returned for files without an extension, accessing outside array boundaries and making files without an extension black, which is hard to see. Change-Id: Ia0883aba929582324b767df7828a36a84c0b36b9
-rw-r--r--apps/filetypes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/filetypes.c b/apps/filetypes.c
index ebccb09eac..38324d0f3a 100644
--- a/apps/filetypes.c
+++ b/apps/filetypes.c
@@ -514,7 +514,7 @@ int filetype_get_color(const char * name, int attr)
return custom_colors[0];
extension = strrchr(name, '.');
if (!extension)
- return custom_colors[unknown_file.color];
+ return unknown_file.color;
extension++;
i = find_extension(extension);