diff options
Diffstat (limited to 'apps/tree.c')
-rw-r--r-- | apps/tree.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/apps/tree.c b/apps/tree.c index fb748a56d6..6f29a43e2d 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -194,18 +194,22 @@ static int compare(const void* p1, const void* p2) | |||
194 | 194 | ||
195 | static void showfileline(int line, int direntry, bool scroll) | 195 | static void showfileline(int line, int direntry, bool scroll) |
196 | { | 196 | { |
197 | /* if music filter is on, cut off the extension */ | 197 | /* if any file filter is on, strip the extension */ |
198 | if (global_settings.dirfilter == SHOW_MUSIC && | 198 | if (global_settings.dirfilter != SHOW_ALL && |
199 | (dircache[direntry].attr & (TREE_ATTR_M3U|TREE_ATTR_MPA))) | 199 | !(dircache[direntry].attr & ATTR_DIRECTORY)) |
200 | { | 200 | { |
201 | int len = strlen(dircache[direntry].name); | 201 | char* dotpos = strrchr(dircache[direntry].name, '.'); |
202 | char temp = dircache[direntry].name[len-4]; | 202 | char temp; |
203 | dircache[direntry].name[len-4] = 0; | 203 | if (dotpos) { |
204 | temp = *dotpos; | ||
205 | *dotpos = 0; | ||
206 | } | ||
204 | if(scroll) | 207 | if(scroll) |
205 | lcd_puts_scroll(LINE_X, line, dircache[direntry].name); | 208 | lcd_puts_scroll(LINE_X, line, dircache[direntry].name); |
206 | else | 209 | else |
207 | lcd_puts(LINE_X, line, dircache[direntry].name); | 210 | lcd_puts(LINE_X, line, dircache[direntry].name); |
208 | dircache[direntry].name[len-4] = temp; | 211 | if (dotpos) |
212 | *dotpos = temp; | ||
209 | } | 213 | } |
210 | else { | 214 | else { |
211 | if(scroll) | 215 | if(scroll) |