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

This commit is contained in:
dbaron@fas.harvard.edu
2001-11-07 04:12:20 +00:00
parent f410daef28
commit 130be4eb02
22 changed files with 391 additions and 85 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;