forked from len0rd/rockbox
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
This commit is contained in:
parent
98c34d8723
commit
15fa7f866f
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue