1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:17:44 +00:00

Don't include empty segments in canonicalized paths.

This makes "/foo/" and "/foo" both resolve to "/foo".
This commit is contained in:
Andreas Kling 2018-11-10 15:46:39 +01:00
parent 39d6b96d21
commit c653bb09b3

View file

@ -26,7 +26,8 @@ bool FileSystemPath::canonicalize(bool resolveSymbolicLinks)
canonicalParts.takeLast();
continue;
}
canonicalParts.append(part);
if (!part.isEmpty())
canonicalParts.append(part);
}
if (canonicalParts.isEmpty()) {
m_string = "/";