Fix copy of current/opposite path to command line: remove charset info from path

This commit is contained in:
Slava Zanko 2009-05-04 12:40:06 +03:00
parent 6f390f5cf3
commit 841a47e163
3 changed files with 16 additions and 5 deletions

View File

@ -1123,26 +1123,35 @@ create_panels (void)
static void
copy_current_pathname (void)
{
char *cwd_path;
if (!command_prompt)
return;
command_insert (cmdline, current_panel->cwd, 0);
if (current_panel->cwd[strlen (current_panel->cwd) - 1] != PATH_SEP)
cwd_path = remove_encoding_from_path (current_panel->cwd);
command_insert (cmdline, cwd_path, 0);
if (cwd_path [strlen (cwd_path ) - 1] != PATH_SEP)
command_insert (cmdline, PATH_SEP_STR, 0);
g_free (cwd_path);
}
static void
copy_other_pathname (void)
{
char *cwd_path;
if (get_other_type () != view_listing)
return;
if (!command_prompt)
return;
command_insert (cmdline, other_panel->cwd, 0);
if (other_panel->cwd[strlen (other_panel->cwd) - 1] != PATH_SEP)
cwd_path = remove_encoding_from_path (other_panel->cwd);
command_insert (cmdline, cwd_path, 0);
if (cwd_path [strlen (cwd_path ) - 1] != PATH_SEP)
command_insert (cmdline, PATH_SEP_STR, 0);
g_free (cwd_path);
}
static void

View File

@ -130,6 +130,8 @@ void do_possible_cd (const char *dir);
void done_menu (void);
void init_menu (void);
char *remove_encoding_from_path (const char *);
#define MC_BASE "/.mc/"
void directory_history_add (struct WPanel *panel, const char *dir);

View File

@ -905,7 +905,7 @@ static char
return result;
}
static char *
char *
remove_encoding_from_path (const char *path)
{
GString *ret;