diff --git a/mozilla/chrome/src/nsChromeProtocolHandler.cpp b/mozilla/chrome/src/nsChromeProtocolHandler.cpp index 0df7c09c126..d883a55ed3f 100644 --- a/mozilla/chrome/src/nsChromeProtocolHandler.cpp +++ b/mozilla/chrome/src/nsChromeProtocolHandler.cpp @@ -118,15 +118,17 @@ nsChromeProtocolHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI* url; if (aBaseURI) { rv = aBaseURI->Clone(&url); + if (NS_FAILED(rv)) return rv; + rv = url->SetRelativePath(aSpec); } else { rv = nsComponentManager::CreateInstance(kStandardURLCID, nsnull, nsCOMTypeInfo::GetIID(), (void**)&url); + if (NS_FAILED(rv)) return rv; + rv = url->SetSpec((char*)aSpec); } - if (NS_FAILED(rv)) return rv; - rv = url->SetSpec((char*)aSpec); if (NS_FAILED(rv)) { NS_RELEASE(url); return rv; diff --git a/mozilla/chrome/src/nsChromeRegistry.cpp b/mozilla/chrome/src/nsChromeRegistry.cpp index fe79cc677b5..777f46d2c80 100644 --- a/mozilla/chrome/src/nsChromeRegistry.cpp +++ b/mozilla/chrome/src/nsChromeRegistry.cpp @@ -256,7 +256,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL) #endif // Construct a chrome URL and use it to look up a resource. - nsAutoString windowType = nsAutoString("chrome://") + hostStr + "/"; + nsAutoString windowType = nsAutoString("chrome://") + hostStr ; // Stash any search part of the URL for later #ifdef NECKO @@ -293,12 +293,12 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL) if (slashIndex == -1) slashIndex = restOfURL.Length(); - restOfURL.Mid(packageType, 1, slashIndex - 1); + restOfURL.Mid(packageType, 0, slashIndex); if (slashIndex < restOfURL.Length()-1) { // There are some extra subdirectories to remember. - restOfURL.Right(path, restOfURL.Length()-slashIndex-1); + restOfURL.Right(path, restOfURL.Length()-slashIndex); } } diff --git a/mozilla/dom/src/jsurl/nsJSProtocolHandler.cpp b/mozilla/dom/src/jsurl/nsJSProtocolHandler.cpp index 8015f23b27a..29328670a7c 100644 --- a/mozilla/dom/src/jsurl/nsJSProtocolHandler.cpp +++ b/mozilla/dom/src/jsurl/nsJSProtocolHandler.cpp @@ -95,6 +95,7 @@ public: nsresult Eval() { nsresult rv; + //TODO Change this to GetSpec and then skip past the javascript: // Get the expression: char* jsExpr; rv = mURI->GetPath(&jsExpr); diff --git a/mozilla/rdf/chrome/src/nsChromeProtocolHandler.cpp b/mozilla/rdf/chrome/src/nsChromeProtocolHandler.cpp index 0df7c09c126..d883a55ed3f 100644 --- a/mozilla/rdf/chrome/src/nsChromeProtocolHandler.cpp +++ b/mozilla/rdf/chrome/src/nsChromeProtocolHandler.cpp @@ -118,15 +118,17 @@ nsChromeProtocolHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI* url; if (aBaseURI) { rv = aBaseURI->Clone(&url); + if (NS_FAILED(rv)) return rv; + rv = url->SetRelativePath(aSpec); } else { rv = nsComponentManager::CreateInstance(kStandardURLCID, nsnull, nsCOMTypeInfo::GetIID(), (void**)&url); + if (NS_FAILED(rv)) return rv; + rv = url->SetSpec((char*)aSpec); } - if (NS_FAILED(rv)) return rv; - rv = url->SetSpec((char*)aSpec); if (NS_FAILED(rv)) { NS_RELEASE(url); return rv; diff --git a/mozilla/rdf/chrome/src/nsChromeRegistry.cpp b/mozilla/rdf/chrome/src/nsChromeRegistry.cpp index fe79cc677b5..777f46d2c80 100644 --- a/mozilla/rdf/chrome/src/nsChromeRegistry.cpp +++ b/mozilla/rdf/chrome/src/nsChromeRegistry.cpp @@ -256,7 +256,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL) #endif // Construct a chrome URL and use it to look up a resource. - nsAutoString windowType = nsAutoString("chrome://") + hostStr + "/"; + nsAutoString windowType = nsAutoString("chrome://") + hostStr ; // Stash any search part of the URL for later #ifdef NECKO @@ -293,12 +293,12 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL) if (slashIndex == -1) slashIndex = restOfURL.Length(); - restOfURL.Mid(packageType, 1, slashIndex - 1); + restOfURL.Mid(packageType, 0, slashIndex); if (slashIndex < restOfURL.Length()-1) { // There are some extra subdirectories to remember. - restOfURL.Right(path, restOfURL.Length()-slashIndex-1); + restOfURL.Right(path, restOfURL.Length()-slashIndex); } }