[Bugfix] OpenPlugin on multivolume targets

to check for against /.rockbox/viewers (VIEWERS_DIR) on multivolume you
need to strip all the prefix junk of volume and potentially strip the
redirect directory

Change-Id: I8e24c43d84c3b90ffb4bbf62d4287620a5890ade
This commit is contained in:
William Wilgus 2025-01-15 12:24:55 -05:00
parent a5663ab3c0
commit 9310b51841

View file

@ -413,9 +413,15 @@ void open_plugin_browse(const char *key)
if (rockbox_browse(&browse) == GO_TO_PREVIOUS)
{
open_plugin_add_path(key, tmp_buf, NULL);
const char *path = tmp_buf;
#ifdef HAVE_MULTIVOLUME
path = strstr(path, ROCKBOX_DIR);
if (!path)
path = tmp_buf;
#endif
/* if this is a viewer ask the user if they want to set a parameter */
if (op_entry->lang_id > 0
&& strncmp(tmp_buf, VIEWERS_DIR, sizeof(VIEWERS_DIR) -1) == 0)
&& strncmp(path, VIEWERS_DIR, sizeof(VIEWERS_DIR) -1) == 0)
{
if (yesno_pop(ID2P(LANG_PARAMETER)))
{