summaryrefslogtreecommitdiff
path: root/apps/filetypes.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/filetypes.c')
-rw-r--r--apps/filetypes.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/filetypes.c b/apps/filetypes.c
index 530dab18c4..76cd726458 100644
--- a/apps/filetypes.c
+++ b/apps/filetypes.c
@@ -448,7 +448,8 @@ int filetype_list_viewers(const char* current_file)
448 int j; 448 int j;
449 for (j=0;j<count;j++) /* check if the plugin is in the list yet */ 449 for (j=0;j<count;j++) /* check if the plugin is in the list yet */
450 { 450 {
451 if (items[j] == i) 451 if (filetypes[i].plugin &&
452 !strcmp(filetypes[i].plugin,filetypes[items[j]].plugin))
452 break; 453 break;
453 } 454 }
454 if (j<count) 455 if (j<count)
@@ -479,9 +480,11 @@ int filetype_list_viewers(const char* current_file)
479 continue; 480 continue;
480 else if (action == ACTION_STD_OK) 481 else if (action == ACTION_STD_OK)
481 { 482 {
482 i = gui_synclist_get_sel_pos(&lists); 483 char plugin[MAX_PATH];
483 return filetype_load_plugin(filetypes[i].plugin, 484 i = items[gui_synclist_get_sel_pos(&lists)];
484 (void*)current_file); 485 snprintf(plugin, MAX_PATH, "%s/%s.%s",
486 PLUGIN_DIR, filetypes[i].plugin, ROCK_EXTENSION);
487 return plugin_load(plugin, (char*)current_file);
485 } 488 }
486 else if (action == ACTION_STD_CANCEL) 489 else if (action == ACTION_STD_CANCEL)
487 return action; 490 return action;