Add assertions that users of nsDependentC?String meet the requirements of nsAFlatC?String. Add nsDependentSingleFragmentC?Substring for users that don't. Additional cleanup after bug 100214. b=104651 r=jag sr=scc

git-svn-id: svn://10.0.0.236/trunk@107556 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%fas.harvard.edu
2001-11-07 04:12:20 +00:00
parent a38af362a7
commit 52bea38360
26 changed files with 430 additions and 105 deletions

View File

@@ -262,11 +262,10 @@ nsLocalFile::InitWithPath(const char *filePath)
NS_ENSURE_ARG(filePath);
ssize_t len = strlen(filePath);
char *name = (char *) nsMemory::Clone(filePath, len+1);
while (name[len-1] == '/' && len > 1)
name[--len] = '\0';
mPath.Adopt(name);
while (filePath[len-1] == '/' && len > 1)
--len;
// XXXldb change to |Assign| rather than |Adopt(ToNewCString|
mPath.Adopt(ToNewCString(Substring(filePath, filePath+len)));
InvalidateCache();
return NS_OK;