ugh. I did not mean to commit these changes. Backing out

This commit is contained in:
dougt@netscape.com
2001-10-30 22:19:32 +00:00
parent 5b8e7b5c11
commit d1f771603f
5 changed files with 30 additions and 99 deletions

View File

@@ -1425,23 +1425,22 @@ 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);
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 += "/";
}
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 += "/";
}
*aURL = ToNewCString(escPath);
rv = *aURL ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
}
}
CRTFREEIF(ePath);
return rv;