Go to the documentation of this file.
54 if (*dst ==
'/' || *dst ==
'~') {
60 p = strrchr(
path,
'/');
71 #if defined(DEBUG_PATH)
93 #if defined(DEBUG_PATH)
101 if ((w ==
path && *
path ==
'/') || (w >
path && w[-1] !=
'/'))
113 #if defined(DEBUG_PATH)
114 LOG(
llevDebug,
"path_normalize: checking '%.*s'\n", (
int)len, p);
117 if (len == 1 && *p ==
'.') {
119 }
else if (len == 2 && memcmp(p,
"..", 2) == 0) {
120 if (w ==
path || (w ==
path+3 && memcmp(
path,
"../", 3) == 0)) {
124 }
else if (w ==
path+1 && *
path ==
'/') {
128 if (w >
path && w[-1] ==
'/')
130 while (w >
path && w[-1] !=
'/')
141 #if defined(DEBUG_PATH)
147 while (w >
path+1 && w[-1] ==
'/') {
153 #if defined(DEBUG_PATH)
void path_normalize(char *path)
char * path_combine_and_normalize(const char *src, const char *dst, char *path, size_t size)
char * path_combine(const char *src, const char *dst, char *path, size_t size)
size_t strlcpy(char *dst, const char *src, size_t size)
void LOG(LogLevel logLevel, const char *format,...)