Moving nsISimpleEnumeratory interface into a seperate idl file. bug 99136. r=alecf@netscape.com, sr=rpotts@netscape.com

git-svn-id: svn://10.0.0.236/trunk@106715 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dougt%netscape.com
2001-10-30 22:03:05 +00:00
parent fad8f3eb7f
commit 3e064cf384
9 changed files with 103 additions and 31 deletions

View File

@@ -1425,22 +1425,23 @@ NS_IMETHODIMP nsLocalFile::GetURL(char * *aURL)
rv = GetPath(&ePath);
if (NS_SUCCEEDED(rv)) {
SwapSlashColon(ePath);
// Escape the path with the directory mask
rv = nsStdEscape(ePath, esc_Directory+esc_Forced, escPath);
if (NS_SUCCEEDED(rv)) {
escPath.Insert("file://", 0);
PRBool dir;
rv = IsDirectory(&dir);
NS_ASSERTION(NS_SUCCEEDED(rv), "Cannot tell if this is a directory");
if (NS_SUCCEEDED(rv) && dir && escPath[escPath.Length() - 1] != '/') {
// make sure we have a trailing slash
escPath += "/";
escPath.Insert("file:///", 0);
if (escPath[escPath.Length() - 1] != '/') {
PRBool dir;
rv = IsDirectory(&dir);
NS_ASSERTION(NS_SUCCEEDED(rv), "Cannot tell if this is a directory");
if (NS_SUCCEEDED(rv) && dir) {
// make sure we have a trailing slash
escPath += "/";
}
}
*aURL = ToNewCString(escPath);
rv = *aURL ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
}
}
CRTFREEIF(ePath);
return rv;