Fix segfault on adding current path to hotlist.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2021-01-03 08:15:56 +03:00
parent 485ea75cbe
commit 5a45ed1583
5 changed files with 13 additions and 10 deletions

View File

@ -1081,11 +1081,11 @@ edit_fhl_cmd (void)
/* --------------------------------------------------------------------------------------------- */
void
hotlist_cmd (void)
hotlist_cmd (WPanel * panel)
{
char *target;
target = hotlist_show (LIST_HOTLIST);
target = hotlist_show (LIST_HOTLIST, panel);
if (target == NULL)
return;
@ -1115,12 +1115,12 @@ hotlist_cmd (void)
#ifdef ENABLE_VFS
void
vfs_list (void)
vfs_list (WPanel * panel)
{
char *target;
vfs_path_t *target_vpath;
target = hotlist_show (LIST_VFSLIST);
target = hotlist_show (LIST_VFSLIST, panel);
if (target == NULL)
return;

View File

@ -68,11 +68,11 @@ void delete_cmd (WPanel * panel);
void delete_cmd_local (WPanel * panel);
void filter_cmd (void);
void reread_cmd (void);
void vfs_list (void);
void vfs_list (WPanel * panel);
void ext_cmd (void);
void edit_mc_menu_cmd (void);
void edit_fhl_cmd (void);
void hotlist_cmd (void);
void hotlist_cmd (WPanel * panel);
void compare_dirs_cmd (void);
#ifdef USE_DIFF_VIEW
void diff_view_cmd (void);

View File

@ -1331,7 +1331,7 @@ midnight_execute_cmd (Widget * sender, long command)
quick_cd_cmd (current_panel);
break;
case CK_HotList:
hotlist_cmd ();
hotlist_cmd (current_panel);
break;
case CK_PanelQuickView:
if (sender == WIDGET (the_menubar))
@ -1356,7 +1356,7 @@ midnight_execute_cmd (Widget * sender, long command)
break;
#ifdef ENABLE_VFS
case CK_VfsList:
vfs_list ();
vfs_list (current_panel);
break;
#endif
case CK_SaveSetup:

View File

@ -1632,11 +1632,14 @@ add2hotlist_cmd (WPanel * panel)
/* --------------------------------------------------------------------------------------------- */
char *
hotlist_show (hotlist_t list_type)
hotlist_show (hotlist_t list_type, WPanel * panel)
{
char *target = NULL;
int res;
/* extra variable to use it in the button callback */
our_panel = panel;
hotlist_state.type = list_type;
load_hotlist ();

View File

@ -25,7 +25,7 @@ typedef enum
/*** declarations of public functions ************************************************************/
void add2hotlist_cmd (WPanel * panel);
char *hotlist_show (hotlist_t list_type);
char *hotlist_show (hotlist_t list_type, WPanel * panel);
gboolean save_hotlist (void);
void done_hotlist (void);