1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:24:57 +00:00

AK: Make LexicalPath handle relative paths correctly

Previously LexicalPath would consider "." and ".." as equivalent to
"/". This is not true though.
This commit is contained in:
Gunnar Beutner 2021-05-18 01:59:13 +02:00 committed by Andreas Kling
parent ebb1d9740e
commit c99fd217e2
2 changed files with 5 additions and 1 deletions

View file

@ -55,7 +55,7 @@ void LexicalPath::canonicalize()
}
}
if (canonical_parts.is_empty()) {
m_string = m_basename = m_dirname = "/";
m_string = m_basename = m_dirname = m_is_absolute ? "/" : ".";
return;
}