65
65
#include "lib/util.h"
66
66
#include "lib/widget.h" // message()
67
67
#include "lib/vfs/xdirentry.h"
68
-
69
- #ifdef HAVE_CHARSET
70
68
#include "lib/charsets.h"
71
- #endif
72
69
73
70
/*** global variables ****************************************************************************/
74
71
@@ -903,9 +900,7 @@ canonicalize_pathname_custom (char *path, canon_path_flags_t flags)
903
900
// Collapse "/.." with the previous part of path
904
901
if ((flags & CANON_PATH_REMDOUBLEDOTS ) != 0 )
905
902
{
906
- #ifdef HAVE_CHARSET
907
903
const size_t enc_prefix_len = strlen (VFS_ENCODING_PREFIX );
908
- #endif
909
904
910
905
for (p = lpath ; p [0 ] != '\0' && p [1 ] != '\0' && p [2 ] != '\0' ;)
911
906
{
@@ -975,7 +970,6 @@ canonicalize_pathname_custom (char *path, canon_path_flags_t flags)
975
970
else
976
971
{
977
972
// "token/../foo" -> "foo"
978
- #ifdef HAVE_CHARSET
979
973
if (strncmp (s , VFS_ENCODING_PREFIX , enc_prefix_len ) == 0 )
980
974
{
981
975
char * enc ;
@@ -991,7 +985,6 @@ canonicalize_pathname_custom (char *path, canon_path_flags_t flags)
991
985
g_free (enc );
992
986
}
993
987
else
994
- #endif
995
988
str_move (s , p + 4 );
996
989
}
997
990
@@ -1012,7 +1005,6 @@ canonicalize_pathname_custom (char *path, canon_path_flags_t flags)
1012
1005
// "foo/token/.." -> "foo"
1013
1006
if (s == lpath + 1 )
1014
1007
s [0 ] = '\0' ;
1015
- #ifdef HAVE_CHARSET
1016
1008
else if (strncmp (s , VFS_ENCODING_PREFIX , enc_prefix_len ) == 0 )
1017
1009
{
1018
1010
char * enc ;
@@ -1038,12 +1030,9 @@ canonicalize_pathname_custom (char *path, canon_path_flags_t flags)
1038
1030
if (p >= lpath )
1039
1031
continue ;
1040
1032
}
1041
- #endif
1042
1033
else
1043
1034
{
1044
- #ifdef HAVE_CHARSET
1045
1035
last :
1046
- #endif
1047
1036
if (s >= lpath + url_delim_len
1048
1037
&& strncmp (s - url_delim_len , VFS_PATH_URL_DELIMITER , url_delim_len ) == 0 )
1049
1038
* s = '\0' ;
@@ -1062,7 +1051,6 @@ canonicalize_pathname_custom (char *path, canon_path_flags_t flags)
1062
1051
char *
1063
1052
mc_realpath (const char * path , char * resolved_path )
1064
1053
{
1065
- #ifdef HAVE_CHARSET
1066
1054
const char * p = path ;
1067
1055
gboolean absolute_path = FALSE;
1068
1056
@@ -1085,7 +1073,6 @@ mc_realpath (const char *path, char *resolved_path)
1085
1073
path = p ;
1086
1074
}
1087
1075
}
1088
- #endif
1089
1076
1090
1077
#ifdef HAVE_REALPATH
1091
1078
return realpath (path , resolved_path );
0 commit comments