mirror of https://github.com/MidnightCommander/mc
Fix copy of current/opposite path to command line: remove charset info from path
This commit is contained in:
parent
6f390f5cf3
commit
841a47e163
17
src/main.c
17
src/main.c
|
@ -1123,26 +1123,35 @@ create_panels (void)
|
||||||
static void
|
static void
|
||||||
copy_current_pathname (void)
|
copy_current_pathname (void)
|
||||||
{
|
{
|
||||||
|
char *cwd_path;
|
||||||
if (!command_prompt)
|
if (!command_prompt)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
command_insert (cmdline, current_panel->cwd, 0);
|
cwd_path = remove_encoding_from_path (current_panel->cwd);
|
||||||
if (current_panel->cwd[strlen (current_panel->cwd) - 1] != PATH_SEP)
|
command_insert (cmdline, cwd_path, 0);
|
||||||
|
|
||||||
|
if (cwd_path [strlen (cwd_path ) - 1] != PATH_SEP)
|
||||||
command_insert (cmdline, PATH_SEP_STR, 0);
|
command_insert (cmdline, PATH_SEP_STR, 0);
|
||||||
|
g_free (cwd_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
copy_other_pathname (void)
|
copy_other_pathname (void)
|
||||||
{
|
{
|
||||||
|
char *cwd_path;
|
||||||
|
|
||||||
if (get_other_type () != view_listing)
|
if (get_other_type () != view_listing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!command_prompt)
|
if (!command_prompt)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
command_insert (cmdline, other_panel->cwd, 0);
|
cwd_path = remove_encoding_from_path (other_panel->cwd);
|
||||||
if (other_panel->cwd[strlen (other_panel->cwd) - 1] != PATH_SEP)
|
command_insert (cmdline, cwd_path, 0);
|
||||||
|
|
||||||
|
if (cwd_path [strlen (cwd_path ) - 1] != PATH_SEP)
|
||||||
command_insert (cmdline, PATH_SEP_STR, 0);
|
command_insert (cmdline, PATH_SEP_STR, 0);
|
||||||
|
g_free (cwd_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -130,6 +130,8 @@ void do_possible_cd (const char *dir);
|
||||||
void done_menu (void);
|
void done_menu (void);
|
||||||
void init_menu (void);
|
void init_menu (void);
|
||||||
|
|
||||||
|
char *remove_encoding_from_path (const char *);
|
||||||
|
|
||||||
#define MC_BASE "/.mc/"
|
#define MC_BASE "/.mc/"
|
||||||
|
|
||||||
void directory_history_add (struct WPanel *panel, const char *dir);
|
void directory_history_add (struct WPanel *panel, const char *dir);
|
||||||
|
|
|
@ -905,7 +905,7 @@ static char
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
char *
|
||||||
remove_encoding_from_path (const char *path)
|
remove_encoding_from_path (const char *path)
|
||||||
{
|
{
|
||||||
GString *ret;
|
GString *ret;
|
||||||
|
|
Loading…
Reference in New Issue