skip ./ on relative paths

This commit is contained in:
Stefanos Kornilios Mitsis Poiitidis
2025-02-24 05:22:51 +02:00
parent 428036968f
commit ed540c8e00

View File

@@ -194,6 +194,10 @@ char* casepath(char const* path, bool checkPathFirst)
}
size_t l = strlen(path);
if (l > 2 && path[0] == '.' && (path[1] == '/' || path[1] == '\\')) {
// remove ./ from the start of the path
path += 2;
}
char* p = (char*)alloca(l + 1);
char* out = (char*)malloc(l + 3); // for extra ./
strcpy(p, path);