Browse Source

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>
Andrew Borodin 10 months ago
parent
commit
46ea5e2a99
2 changed files with 14 additions and 2 deletions
  1. 2 0
      lib/vfs/path.c
  2. 12 2
      tests/lib/mc_realpath.c

+ 2 - 0
lib/vfs/path.c

@@ -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;
 

+ 12 - 2
tests/lib/mc_realpath.c

@@ -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* */