mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-05 11:04:42 +03:00
(edit_ok_to_exit): get rid of file name string duplication.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
200cb115ab
commit
5d1d542da9
@ -2757,7 +2757,7 @@ edit_search_cmd (WEdit * edit, gboolean again)
|
|||||||
gboolean
|
gboolean
|
||||||
edit_ok_to_exit (WEdit * edit)
|
edit_ok_to_exit (WEdit * edit)
|
||||||
{
|
{
|
||||||
char *fname = (char *) N_("[NoName]");
|
const char *fname = N_("[NoName]");
|
||||||
char *msg;
|
char *msg;
|
||||||
int act;
|
int act;
|
||||||
|
|
||||||
@ -2765,22 +2765,16 @@ edit_ok_to_exit (WEdit * edit)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if (edit->filename_vpath != NULL)
|
if (edit->filename_vpath != NULL)
|
||||||
fname = g_strdup (vfs_path_as_str (edit->filename_vpath));
|
fname = vfs_path_as_str (edit->filename_vpath);
|
||||||
#ifdef ENABLE_NLS
|
#ifdef ENABLE_NLS
|
||||||
else
|
else
|
||||||
fname = g_strdup (_(fname));
|
fname = _(fname);
|
||||||
#else
|
|
||||||
else
|
|
||||||
fname = g_strdup (fname);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!mc_global.midnight_shutdown)
|
if (!mc_global.midnight_shutdown)
|
||||||
{
|
{
|
||||||
if (!edit_check_newline (&edit->buffer))
|
if (!edit_check_newline (&edit->buffer))
|
||||||
{
|
|
||||||
g_free (fname);
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
|
||||||
|
|
||||||
query_set_sel (2);
|
query_set_sel (2);
|
||||||
|
|
||||||
@ -2799,7 +2793,6 @@ edit_ok_to_exit (WEdit * edit)
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_free (msg);
|
g_free (msg);
|
||||||
g_free (fname);
|
|
||||||
|
|
||||||
switch (act)
|
switch (act)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user