Clarify handling of "#enc:".

* (vfs_canon): treate "#enc:" as a regular part of path in case of
    --disable-charset.
  * (realpath_test): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2024-05-05 10:04:38 +03:00
parent 8e55057fa3
commit 46ea5e2a99
2 changed files with 14 additions and 2 deletions

View File

@ -151,6 +151,7 @@ vfs_canon (const char *path)
char *local;
#ifdef HAVE_CHARSET
if (g_str_has_prefix (path, VFS_ENCODING_PREFIX))
{
/*
@ -160,6 +161,7 @@ vfs_canon (const char *path)
local = mc_build_filename (PATH_SEP_STR, path, (char *) NULL);
}
else
#endif
{
const char *curr_dir;

View File

@ -69,14 +69,24 @@ static const struct data_source
{
/* absolute paths */
{ "/", "/"},
{ "/" VFS_ENCODING_PREFIX "UTF-8/", "/" },
{ "/usr/bin", "/usr/bin" },
#ifdef HAVE_CHARSET
{ "/" VFS_ENCODING_PREFIX "UTF-8/", "/" },
{ "/" VFS_ENCODING_PREFIX "UTF-8/usr/bin", "/usr/bin" },
#else
{ "/" VFS_ENCODING_PREFIX "UTF-8/", "/" VFS_ENCODING_PREFIX "UTF-8/" },
{ "/" VFS_ENCODING_PREFIX "UTF-8/usr/bin", "/" VFS_ENCODING_PREFIX "UTF-8/usr/bin" },
#endif
/* relative paths are relative to / */
{ VFS_ENCODING_PREFIX "UTF-8/", "/" },
{ "usr/bin", "/usr/bin" },
#ifdef HAVE_CHARSET
{ VFS_ENCODING_PREFIX "UTF-8/", "/" },
{ VFS_ENCODING_PREFIX "UTF-8/usr/bin", "/usr/bin" }
#else
{ VFS_ENCODING_PREFIX "UTF-8/", VFS_ENCODING_PREFIX "UTF-8/" },
{ VFS_ENCODING_PREFIX "UTF-8/usr/bin", VFS_ENCODING_PREFIX "UTF-8/usr/bin" }
#endif
};
/* *INDENT-ON* */