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

git-svn-id: svn://10.0.0.236/trunk@106720 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dougt%netscape.com
2001-10-30 22:19:32 +00:00
parent e17afbe404
commit 8e551369e9
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;