From b668b7ec9b5b3527d7af31ca0c84261fcebea422 Mon Sep 17 00:00:00 2001 From: "rjc%netscape.com" Date: Thu, 4 Mar 1999 03:01:33 +0000 Subject: [PATCH] Now store pathnames as strings which prevents nr_MacAliasFromPath() from ever being called (it was being passed a Unix path when it really wanted a Mac path anyway). Also, autoregistration now looks inside the "components" directory (which is in the same folder as the program.) Also, bumped up registry version # due to change. Also, at startup, when building up list of arguments, check argv[0] against NULL as it might be (on the Mac). git-svn-id: svn://10.0.0.236/trunk@22761 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/components/nsRepository.cpp | 8 ++++---- mozilla/xpcom/src/nsRepository.cpp | 8 ++++---- mozilla/xpfe/appshell/src/nsCommandLineService.cpp | 13 ++++++++----- .../components/startup/src/nsCommandLineService.cpp | 13 ++++++++----- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/mozilla/xpcom/components/nsRepository.cpp b/mozilla/xpcom/components/nsRepository.cpp index 4635d26b713..f634bceeb11 100644 --- a/mozilla/xpcom/components/nsRepository.cpp +++ b/mozilla/xpcom/components/nsRepository.cpp @@ -47,7 +47,7 @@ * alpha0.20 : First time we did versioning * alpha0.30 : Changing autoreg to begin registration from ./components on unix */ -#define NS_XPCOM_REPOSITORY_VERSION_STRING "alpha0.30" +#define NS_XPCOM_REPOSITORY_VERSION_STRING "alpha0.31" #include "NSReg.h" @@ -467,8 +467,7 @@ static nsresult platformRegister(NSQuickRegisterData regd, nsDll *dll) if (regd->progID) NR_RegSetEntryString(hreg, key, "ProgID", (char *)(regd->progID)); char *libName = (char *)dll->GetFullPath(); - NR_RegSetEntry(hreg, key, "InprocServer", REGTYPE_ENTRY_FILE, libName, - strlen(libName) + 1); + NR_RegSetEntryString(hreg, key, "InprocServer", libName); if (regd->progID) { @@ -621,7 +620,7 @@ static FactoryEntry *platformFind(const nsCID &aCID) char buf[MAXREGNAMELEN]; uint32 len = sizeof(buf); - err = NR_RegGetEntry(hreg, cidKey, "InprocServer", buf, &len); + err = NR_RegGetEntryString(hreg, cidKey, "InprocServer", buf, len); if (err != REGERR_OK) { // Registry inconsistent. No File name for CLSID. @@ -1609,6 +1608,7 @@ nsresult nsRepository::AutoRegister(NSRegistrationInstant when, } while ((!err) && (catInfo.dirInfo.ioDrDirID != 2)); // 2 = root if (!err) { + Munger(pathH, GetHandleSize(pathH)-1, NULL, 0L, "/components", 11); // append "/components" HLock(pathH); SyncComponentsInPathList((const char *)(*pathH)); HUnlock(pathH); diff --git a/mozilla/xpcom/src/nsRepository.cpp b/mozilla/xpcom/src/nsRepository.cpp index 4635d26b713..f634bceeb11 100644 --- a/mozilla/xpcom/src/nsRepository.cpp +++ b/mozilla/xpcom/src/nsRepository.cpp @@ -47,7 +47,7 @@ * alpha0.20 : First time we did versioning * alpha0.30 : Changing autoreg to begin registration from ./components on unix */ -#define NS_XPCOM_REPOSITORY_VERSION_STRING "alpha0.30" +#define NS_XPCOM_REPOSITORY_VERSION_STRING "alpha0.31" #include "NSReg.h" @@ -467,8 +467,7 @@ static nsresult platformRegister(NSQuickRegisterData regd, nsDll *dll) if (regd->progID) NR_RegSetEntryString(hreg, key, "ProgID", (char *)(regd->progID)); char *libName = (char *)dll->GetFullPath(); - NR_RegSetEntry(hreg, key, "InprocServer", REGTYPE_ENTRY_FILE, libName, - strlen(libName) + 1); + NR_RegSetEntryString(hreg, key, "InprocServer", libName); if (regd->progID) { @@ -621,7 +620,7 @@ static FactoryEntry *platformFind(const nsCID &aCID) char buf[MAXREGNAMELEN]; uint32 len = sizeof(buf); - err = NR_RegGetEntry(hreg, cidKey, "InprocServer", buf, &len); + err = NR_RegGetEntryString(hreg, cidKey, "InprocServer", buf, len); if (err != REGERR_OK) { // Registry inconsistent. No File name for CLSID. @@ -1609,6 +1608,7 @@ nsresult nsRepository::AutoRegister(NSRegistrationInstant when, } while ((!err) && (catInfo.dirInfo.ioDrDirID != 2)); // 2 = root if (!err) { + Munger(pathH, GetHandleSize(pathH)-1, NULL, 0L, "/components", 11); // append "/components" HLock(pathH); SyncComponentsInPathList((const char *)(*pathH)); HUnlock(pathH); diff --git a/mozilla/xpfe/appshell/src/nsCommandLineService.cpp b/mozilla/xpfe/appshell/src/nsCommandLineService.cpp index 793038c0333..da57ae77d2e 100644 --- a/mozilla/xpfe/appshell/src/nsCommandLineService.cpp +++ b/mozilla/xpfe/appshell/src/nsCommandLineService.cpp @@ -77,10 +77,13 @@ nsCmdLineService::Initialize(int argc, char ** argv) nsresult rv = nsnull; //Insert the program name - mArgList.AppendElement((void *)PL_strdup("-progname")); - mArgValueList.AppendElement((void *)PL_strdup(argv[0])); - mArgCount++; - i++; + if (argv[0]) + { + mArgList.AppendElement((void *)PL_strdup("-progname")); + mArgValueList.AppendElement((void *)PL_strdup(argv[0])); + mArgCount++; + i++; + } for(i=1; i