From 944fbf507aaaa206e354d36e2a20a75ad5924a7c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 10 Jan 2020 23:09:58 +0100 Subject: [PATCH] Kernel: Custody::absolute_path() should always return "/" for roots A Custody with no parent is always *a* root (although not necessarily the *real* root.) --- Kernel/FileSystem/Custody.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Kernel/FileSystem/Custody.cpp b/Kernel/FileSystem/Custody.cpp index 519c8414d4..6dbdbbec5a 100644 --- a/Kernel/FileSystem/Custody.cpp +++ b/Kernel/FileSystem/Custody.cpp @@ -55,6 +55,8 @@ Custody::~Custody() String Custody::absolute_path() const { + if (!parent()) + return "/"; Vector custody_chain; for (auto* custody = this; custody; custody = custody->parent()) custody_chain.append(custody);