summaryrefslogtreecommitdiff
path: root/apps/filetypes.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/filetypes.c')
-rw-r--r--apps/filetypes.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/apps/filetypes.c b/apps/filetypes.c
index 973f60e6e5..77d73df5cc 100644
--- a/apps/filetypes.c
+++ b/apps/filetypes.c
@@ -424,10 +424,14 @@ int filetype_list_viewers(const char* current_file)
424{ 424{
425 int i, count = 0; 425 int i, count = 0;
426 char *strings[MAX_FILETYPES/2]; 426 char *strings[MAX_FILETYPES/2];
427 char *ext;
427 struct menu_callback_with_desc cb_and_desc = 428 struct menu_callback_with_desc cb_and_desc =
428 { NULL, ID2P(LANG_ONPLAY_OPEN_WITH), Icon_Plugin }; 429 { NULL, ID2P(LANG_ONPLAY_OPEN_WITH), Icon_Plugin };
429 struct menu_item_ex menu; 430 struct menu_item_ex menu;
430 431
432 ext = strrchr(current_file, '.');
433 if (ext)
434 ext++;
431 for (i=0; i<filetype_count && count < (MAX_FILETYPES/2); i++) 435 for (i=0; i<filetype_count && count < (MAX_FILETYPES/2); i++)
432 { 436 {
433 if (filetypes[i].plugin) 437 if (filetypes[i].plugin)
@@ -440,8 +444,15 @@ int filetype_list_viewers(const char* current_file)
440 } 444 }
441 if (j<count) 445 if (j<count)
442 continue; /* it is so grab the next plugin */ 446 continue; /* it is so grab the next plugin */
443 strings[count] = filetypes[i].plugin; 447 if (ext && filetypes[i].extension &&
444 count++; 448 (filetypes[i].extension[0] != '*'))
449 {
450 if (strcasecmp(filetypes[i].extension, ext))
451 continue; /* skip this one */
452 }
453 strings[count] = strrchr(filetypes[i].plugin,'/');
454 if (strings[count])
455 strings[count++]++;
445 } 456 }
446 } 457 }
447#ifndef HAVE_LCD_BITMAP 458#ifndef HAVE_LCD_BITMAP