From 15fa7f866fe3a17afc9699f86e52aef7cb1a09d0 Mon Sep 17 00:00:00 2001 From: Boris Gjenero Date: Wed, 5 Jun 2013 18:35:09 -0400 Subject: 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 --- apps/filetypes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps') 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); -- cgit v1.2.3