diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-11-10 15:46:39 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-11-10 15:46:39 +0100 |
commit | c653bb09b3cbc4fdbb595501c4adbb161607a1fe (patch) | |
tree | 8f22cdc16f05c8ac74e6b78ce73180b5e7449335 /AK | |
parent | 39d6b96d21a999a36bb6ffec5720eb07e4598b48 (diff) | |
download | serenity-c653bb09b3cbc4fdbb595501c4adbb161607a1fe.zip |
Don't include empty segments in canonicalized paths.
This makes "/foo/" and "/foo" both resolve to "/foo".
Diffstat (limited to 'AK')
-rw-r--r-- | AK/FileSystemPath.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/AK/FileSystemPath.cpp b/AK/FileSystemPath.cpp index 8c5ffb4932..88dce0aa56 100644 --- a/AK/FileSystemPath.cpp +++ b/AK/FileSystemPath.cpp @@ -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 = "/"; |