From 56babc3f58359aeab2fe5c4c3a45e21695482b36 Mon Sep 17 00:00:00 2001 From: "pete%alphanumerica.com" Date: Sat, 7 Sep 2002 02:00:31 +0000 Subject: [PATCH] b=121489, r=dougt, sr=bzbarsky Simple fix for nsIFile GetParent to return null when already at the top of the volume Thanks guys for the speedy review. --pete git-svn-id: svn://10.0.0.236/trunk@129027 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/io/nsLocalFileUnix.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mozilla/xpcom/io/nsLocalFileUnix.cpp b/mozilla/xpcom/io/nsLocalFileUnix.cpp index 8dfb846c9c2..dee8fa85d8b 100644 --- a/mozilla/xpcom/io/nsLocalFileUnix.cpp +++ b/mozilla/xpcom/io/nsLocalFileUnix.cpp @@ -1164,6 +1164,10 @@ nsLocalFile::GetParent(nsIFile **aParent) NS_ENSURE_ARG_POINTER(aParent); *aParent = nsnull; + // if '/' we are at the top of the volume, return null + if (mPath.Equals("/")) + return NS_OK; + // I promise to play nice char *buffer = NS_CONST_CAST(char *, mPath.get()), *slashp = buffer;