Bug 183871

Crash on "Show hidden files and directories" [@ nsFileView::SetDirectory(nsIFile*) ]
fix: don't let files be initialized with relative paths.
also fix the directory service to not do that.

r=dougt sr=bzbarsky


git-svn-id: svn://10.0.0.236/trunk@150734 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cbiesinger%web.de
2003-12-25 22:05:01 +00:00
parent ed8dbd69d7
commit 4f3a7ca850
2 changed files with 21 additions and 20 deletions

View File

@@ -270,6 +270,9 @@ nsLocalFile::InitWithNativePath(const nsACString &filePath)
}
mPath = homePath + Substring(filePath, 1, filePath.Length() - 1);
} else if (filePath.IsEmpty() || filePath.First() != '/') {
NS_ERROR("Relative paths not allowed");
return NS_ERROR_FILE_UNRECOGNIZED_PATH;
} else {
mPath = filePath;
}