소스 검색

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

A Custody with no parent is always *a* root (although not necessarily
the *real* root.)
Andreas Kling 5 년 전
부모
커밋
944fbf507a
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      Kernel/FileSystem/Custody.cpp

+ 2 - 0
Kernel/FileSystem/Custody.cpp

@@ -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);