(find_parameters): duplicate path when that is really needed.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2021-10-23 20:53:58 +03:00
parent 88754d040f
commit 50f08e2194

View File

@ -782,21 +782,18 @@ find_parameters (WPanel * panel, char **start_dir, ssize_t * start_dir_len,
case B_TREE:
{
char *temp_dir;
const char *temp_dir;
temp_dir = in_start->buffer;
if (*temp_dir == '\0' || DIR_IS_DOT (temp_dir))
temp_dir = g_strdup (vfs_path_as_str (panel->cwd_vpath));
if (input_is_empty (in_start) || DIR_IS_DOT (in_start->buffer))
temp_dir = vfs_path_as_str (panel->cwd_vpath);
else
temp_dir = g_strdup (temp_dir);
temp_dir = in_start->buffer;
if (in_start_dir != INPUT_LAST_TEXT)
g_free (in_start_dir);
in_start_dir = tree_box (temp_dir);
if (in_start_dir == NULL)
in_start_dir = temp_dir;
else
g_free (temp_dir);
in_start_dir = g_strdup (temp_dir);
input_assign_text (in_start, in_start_dir);