From 4d00173a89a89d1d0483aab81165b6741f970f5c Mon Sep 17 00:00:00 2001 From: "sfraser%netscape.com" Date: Fri, 23 Jul 1999 22:22:47 +0000 Subject: [PATCH] Fix Mac startup crash: #ifdef NECKO around changes that Gagan made yesterday, so that chrome URL resolution works again. git-svn-id: svn://10.0.0.236/trunk@40931 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/chrome/src/nsChromeRegistry.cpp | 19 ++++++++++++++++++- mozilla/rdf/chrome/src/nsChromeRegistry.cpp | 19 ++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/mozilla/chrome/src/nsChromeRegistry.cpp b/mozilla/chrome/src/nsChromeRegistry.cpp index 777f46d2c80..93c8d58ce15 100644 --- a/mozilla/chrome/src/nsChromeRegistry.cpp +++ b/mozilla/chrome/src/nsChromeRegistry.cpp @@ -256,7 +256,11 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL) #endif // Construct a chrome URL and use it to look up a resource. +#ifndef NECKO + nsAutoString windowType = nsAutoString("chrome://") + hostStr + "/"; +#else nsAutoString windowType = nsAutoString("chrome://") + hostStr ; +#endif // Stash any search part of the URL for later #ifdef NECKO @@ -293,12 +297,20 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL) if (slashIndex == -1) slashIndex = restOfURL.Length(); +#ifndef NECKO + restOfURL.Mid(packageType, 1, slashIndex - 1); +#else restOfURL.Mid(packageType, 0, slashIndex); +#endif if (slashIndex < restOfURL.Length()-1) { // There are some extra subdirectories to remember. +#ifndef NECKO + restOfURL.Right(path, restOfURL.Length()-slashIndex-1); +#else restOfURL.Right(path, restOfURL.Length()-slashIndex); +#endif } } @@ -339,7 +351,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL) // Check to see if we should append the "main" entry in the registry. // Only do this when the user doesn't have anything following "skin" // or "content" in the specified URL. - if (path == "") + if (path.IsEmpty()) { PRInt32 length = restOfURL.Length(); if (length > 0) @@ -359,6 +371,11 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL) } else { +#if 0 + // if path starts in a slash, remove it. + if (path[0] == '/') + path.Cut(0, 1); +#endif // XXX Just append the rest of the URL to base to get the actual URL to look up. chromeBase += path; } diff --git a/mozilla/rdf/chrome/src/nsChromeRegistry.cpp b/mozilla/rdf/chrome/src/nsChromeRegistry.cpp index 777f46d2c80..93c8d58ce15 100644 --- a/mozilla/rdf/chrome/src/nsChromeRegistry.cpp +++ b/mozilla/rdf/chrome/src/nsChromeRegistry.cpp @@ -256,7 +256,11 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL) #endif // Construct a chrome URL and use it to look up a resource. +#ifndef NECKO + nsAutoString windowType = nsAutoString("chrome://") + hostStr + "/"; +#else nsAutoString windowType = nsAutoString("chrome://") + hostStr ; +#endif // Stash any search part of the URL for later #ifdef NECKO @@ -293,12 +297,20 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL) if (slashIndex == -1) slashIndex = restOfURL.Length(); +#ifndef NECKO + restOfURL.Mid(packageType, 1, slashIndex - 1); +#else restOfURL.Mid(packageType, 0, slashIndex); +#endif if (slashIndex < restOfURL.Length()-1) { // There are some extra subdirectories to remember. +#ifndef NECKO + restOfURL.Right(path, restOfURL.Length()-slashIndex-1); +#else restOfURL.Right(path, restOfURL.Length()-slashIndex); +#endif } } @@ -339,7 +351,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL) // Check to see if we should append the "main" entry in the registry. // Only do this when the user doesn't have anything following "skin" // or "content" in the specified URL. - if (path == "") + if (path.IsEmpty()) { PRInt32 length = restOfURL.Length(); if (length > 0) @@ -359,6 +371,11 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL) } else { +#if 0 + // if path starts in a slash, remove it. + if (path[0] == '/') + path.Cut(0, 1); +#endif // XXX Just append the rest of the URL to base to get the actual URL to look up. chromeBase += path; }