diff options
author | Boris Gjenero <boris.gjenero@gmail.com> | 2013-06-05 18:35:09 -0400 |
---|---|---|
committer | Boris Gjenero <boris.gjenero@gmail.com> | 2013-06-05 18:35:09 -0400 |
commit | 15fa7f866fe3a17afc9699f86e52aef7cb1a09d0 (patch) | |
tree | 2e73bb423aec0198f5645a8f4d00c80511df8a08 /apps | |
parent | 98c34d8723c949a7fcbc25ddf0e1c753008c982e (diff) | |
download | rockbox-15fa7f866fe3a17afc9699f86e52aef7cb1a09d0.tar.gz rockbox-15fa7f866fe3a17afc9699f86e52aef7cb1a09d0.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
Diffstat (limited to 'apps')
-rw-r--r-- | apps/filetypes.c | 2 |
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) | |||
514 | return custom_colors[0]; | 514 | return custom_colors[0]; |
515 | extension = strrchr(name, '.'); | 515 | extension = strrchr(name, '.'); |
516 | if (!extension) | 516 | if (!extension) |
517 | return custom_colors[unknown_file.color]; | 517 | return unknown_file.color; |
518 | extension++; | 518 | extension++; |
519 | 519 | ||
520 | i = find_extension(extension); | 520 | i = find_extension(extension); |