(expand_format): ret rid of extra string duplication.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2016-01-31 08:41:35 +03:00
parent db1c906ada
commit 1fea17b052

View File

@ -732,7 +732,7 @@ expand_format (const struct WEdit *edit_widget, char c, gboolean do_quote)
{
WPanel *panel = NULL;
char *(*quote_func) (const char *, gboolean);
char *fname = NULL;
const char *fname = NULL;
char *result;
char c_lc;
@ -754,12 +754,12 @@ expand_format (const struct WEdit *edit_widget, char c, gboolean do_quote)
return g_strdup ("");
panel = other_panel;
}
fname = g_strdup (panel->dir.list[panel->selected].fname);
fname = panel->dir.list[panel->selected].fname;
break;
#ifdef USE_INTERNAL_EDIT
case MC_RUN_EDITOR:
fname = g_strdup (edit_get_file_name (edit_widget));
fname = edit_get_file_name (edit_widget);
break;
#endif
@ -904,7 +904,6 @@ expand_format (const struct WEdit *edit_widget, char c, gboolean do_quote)
result = g_strdup ("% ");
result[1] = c;
ret:
g_free (fname);
return result;
}