Don't add current encoding to path again.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2010-09-13 13:29:29 +04:00
parent aff8e42d64
commit 2a47d77351

View File

@ -3548,10 +3548,18 @@ panel_change_encoding (WPanel * panel)
#endif
if (encoding != NULL)
{
cd_path = add_encoding_to_path (panel->cwd, encoding);
if (!do_panel_cd (panel, cd_path, cd_parse_command))
message (D_ERROR, MSG_ERROR, _("Cannot chdir to \"%s\""), cd_path);
g_free (cd_path);
const char *enc;
enc = vfs_get_encoding (panel->cwd);
/* don't add current encoding */
if ((enc == NULL) || (strcmp (encoding, enc) != 0))
{
cd_path = add_encoding_to_path (panel->cwd, encoding);
if (!do_panel_cd (panel, cd_path, cd_parse_command))
message (D_ERROR, MSG_ERROR, _("Cannot chdir to \"%s\""), cd_path);
g_free (cd_path);
}
}
}