mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 10:37:38 -04:00
FS#13263: Rockbox deletes wrong file
The WPS calls onplay() with a pointer to the path of the current track . We need to make a copy of the path so it isn't affected by track changes. Change-Id: I10a2a93da644932033e01ffbfd85cad20abb555d
This commit is contained in:
parent
5c3bbc6a9c
commit
6387d0352e
1 changed files with 8 additions and 1 deletions
|
@ -66,6 +66,7 @@
|
||||||
|
|
||||||
static int context;
|
static int context;
|
||||||
static const char *selected_file = NULL;
|
static const char *selected_file = NULL;
|
||||||
|
static char selected_file_path[MAX_PATH];
|
||||||
static int selected_file_attr = 0;
|
static int selected_file_attr = 0;
|
||||||
static int onplay_result = ONPLAY_OK;
|
static int onplay_result = ONPLAY_OK;
|
||||||
extern struct menu_item_ex file_menu; /* settings_menu.c */
|
extern struct menu_item_ex file_menu; /* settings_menu.c */
|
||||||
|
@ -1856,7 +1857,13 @@ int onplay(char* file, int attr, int from, bool hotkey)
|
||||||
const struct menu_item_ex *menu;
|
const struct menu_item_ex *menu;
|
||||||
onplay_result = ONPLAY_OK;
|
onplay_result = ONPLAY_OK;
|
||||||
context = from;
|
context = from;
|
||||||
selected_file = file;
|
if (file == NULL)
|
||||||
|
selected_file = NULL;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strlcpy(selected_file_path, file, MAX_PATH);
|
||||||
|
selected_file = selected_file_path;
|
||||||
|
}
|
||||||
selected_file_attr = attr;
|
selected_file_attr = attr;
|
||||||
int menu_selection;
|
int menu_selection;
|
||||||
#ifdef HAVE_HOTKEY
|
#ifdef HAVE_HOTKEY
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue