mirror of
https://github.com/MidnightCommander/mc
synced 2025-02-05 01:44:22 +03:00
(do_link): minor optimization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
55bafd40e5
commit
3a3a6479d3
@ -351,20 +351,24 @@ static void
|
||||
do_link (link_type_t link_type, const char *fname)
|
||||
{
|
||||
char *dest = NULL, *src = NULL;
|
||||
vfs_path_t *fname_vpath, *dest_vpath = NULL;
|
||||
vfs_path_t *dest_vpath = NULL;
|
||||
|
||||
fname_vpath = vfs_path_from_str (fname);
|
||||
if (link_type == LINK_HARDLINK)
|
||||
{
|
||||
vfs_path_t *fname_vpath;
|
||||
|
||||
src = g_strdup_printf (_("Link %s to:"), str_trunc (fname, 46));
|
||||
dest =
|
||||
input_expand_dialog (_("Link"), src, MC_HISTORY_FM_LINK, "", INPUT_COMPLETE_FILENAMES);
|
||||
if (dest == NULL || *dest == '\0')
|
||||
goto cleanup;
|
||||
save_cwds_stat ();
|
||||
|
||||
fname_vpath = vfs_path_from_str (fname);
|
||||
dest_vpath = vfs_path_from_str (dest);
|
||||
if (mc_link (fname_vpath, dest_vpath) == -1)
|
||||
message (D_ERROR, MSG_ERROR, _("link: %s"), unix_error_string (errno));
|
||||
vfs_path_free (fname_vpath);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -409,7 +413,6 @@ do_link (link_type_t link_type, const char *fname)
|
||||
repaint_screen ();
|
||||
|
||||
cleanup:
|
||||
vfs_path_free (fname_vpath);
|
||||
vfs_path_free (dest_vpath);
|
||||
g_free (src);
|
||||
g_free (dest);
|
||||
|
Loading…
x
Reference in New Issue
Block a user