(save_panel_dir): minor refactoring.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2019-08-17 14:07:05 +03:00
parent 97bc63d7ac
commit 07d2f11712

View File

@ -1345,16 +1345,20 @@ get_other_type (void)
void
save_panel_dir (int idx)
{
panel_view_mode_t type = get_panel_type (idx);
Widget *widget = get_panel_widget (idx);
panel_view_mode_t type;
if ((type == view_listing) && (widget != NULL))
type = get_panel_type (idx);
if (type == view_listing)
{
WPanel *w = PANEL (widget);
WPanel *p;
p = PANEL (get_panel_widget (idx));
if (p != NULL)
{
g_free (panels[idx].last_saved_dir); /* last path no needed */
/* Because path can be nonlocal */
panels[idx].last_saved_dir = g_strdup (vfs_path_as_str (w->cwd_vpath));
panels[idx].last_saved_dir = g_strdup (vfs_path_as_str (p->cwd_vpath));
}
}
}