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

Kernel: Custody::absolute_path() should always return "/" for roots

A Custody with no parent is always *a* root (although not necessarily
the *real* root.)
This commit is contained in:
Andreas Kling 2020-01-10 23:09:58 +01:00
parent 485443bfca
commit 944fbf507a

View file

@ -55,6 +55,8 @@ Custody::~Custody()
String Custody::absolute_path() const
{
if (!parent())
return "/";
Vector<const Custody*, 32> custody_chain;
for (auto* custody = this; custody; custody = custody->parent())
custody_chain.append(custody);