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:
Boris Gjenero 2013-06-05 18:35:09 -04:00
parent 98c34d8723
commit 15fa7f866f

View file

@ -514,7 +514,7 @@ int filetype_get_color(const char * name, int attr)
return custom_colors[0]; return custom_colors[0];
extension = strrchr(name, '.'); extension = strrchr(name, '.');
if (!extension) if (!extension)
return custom_colors[unknown_file.color]; return unknown_file.color;
extension++; extension++;
i = find_extension(extension); i = find_extension(extension);