Changeset 608 in vbox for trunk/src/libs/xpcom18a4/xpcom
- Timestamp:
- Feb 4, 2007 9:29:38 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/xpcom/glue/standalone/nsGREDirServiceProvider.cpp
r1 r608 89 89 //***************************************************************************** 90 90 // nsGREDirServiceProvider::nsISupports 91 //***************************************************************************** 91 //***************************************************************************** 92 92 93 93 NS_IMPL_ISUPPORTS1(nsGREDirServiceProvider, nsIDirectoryServiceProvider) 94 94 95 95 //***************************************************************************** 96 96 // nsGREDirServiceProvider::nsIDirectoryServiceProvider 97 //***************************************************************************** 97 //***************************************************************************** 98 98 99 99 NS_IMETHODIMP … … 125 125 //***************************************************************************** 126 126 // Implementations from nsXPCOMGlue.h and helper functions. 127 //***************************************************************************** 127 //***************************************************************************** 128 128 129 129 PRBool … … 163 163 CFRelease(bundleURL); 164 164 } 165 #if 0 /* bird: Causes crashes in objc_msgSend() later if released. I dunno why really. 166 Something could be seriously screwed up somewhere else, but this'll have 167 to do for now. (appBundle isn't released in the other place it's used.) */ 165 168 CFRelease(appBundle); 169 #endif 166 170 } 167 171 if (*buffer) return PR_TRUE; … … 178 182 buf2[0] = '\0'; 179 183 180 /* 184 /* 181 185 * Env.var. VBOX_XPCOM_HOME first. 182 186 */ … … 186 190 if (strlen(psz) < MAXPATHLEN) 187 191 { 188 if (!realpath(psz, buf2)) 192 if (!realpath(psz, buf2)) 189 193 strcpy(buf2, psz); 190 194 strcat(buf2, "/x"); /* for the filename stripping */ … … 213 217 char buf[MAXPATHLEN]; 214 218 int cchLink = readlink("/proc/self/exe", buf, sizeof(buf) - 1); 215 if (cchLink > 0 || cchLink != sizeof(buf) - 1) 219 if (cchLink > 0 || cchLink != sizeof(buf) - 1) 216 220 { 217 221 buf[cchLink] = '\0'; … … 232 236 #ifdef DEBUG 233 237 printf("debug: (1) VBOX_XPCOM_HOME=%s\n", buf2); 234 #endif 238 #endif 235 239 strcpy(szPath, buf2); 236 240 fPathSet = true; … … 252 256 // The MOZ_DEFAULT_VBOX_XPCOM_HOME variable can be set at configure time with 253 257 // a --with-default-mozilla-five-home=foo autoconf flag. 254 // 258 // 255 259 // The idea here is to allow for builds that have a default VBOX_XPCOM_HOME 256 260 // regardless of the environment. This makes it easier to write apps that 257 // embed mozilla without having to worry about setting up the environment 261 // embed mozilla without having to worry about setting up the environment 258 262 // 259 263 // We do this py putenv()ing the default value into the environment. Note that … … 333 337 334 338 #endif 335 339 336 340 return PR_FALSE; 337 341 } … … 350 354 if (*sGRELocation) 351 355 return sGRELocation; 352 356 353 357 char buffer[MAXPATHLEN]; 354 358 355 359 // If the xpcom library exists in the current process directory, 356 360 // then we will not use any GRE. The assumption here is that the … … 362 366 struct stat libStat; 363 367 int statResult = stat(buffer, &libStat); 364 368 365 369 if (statResult != -1) { 366 370 //found our xpcom lib in the current process directory … … 395 399 if (env && *env) { 396 400 sprintf(buffer, "%s" XPCOM_FILE_PATH_SEPARATOR GRE_CONF_NAME, env); 397 401 398 402 if (GRE_GetPathFromConfigFile(buffer, sGRELocation)) { 399 403 return sGRELocation; … … 420 424 } 421 425 #endif 422 426 423 427 #if XP_WIN32 424 428 char szKey[256]; 425 429 HKEY hRegKey = NULL; 426 430 DWORD dwLength = MAXPATHLEN; 427 431 428 432 // A couple of key points here: 429 433 // 1. Note the usage of the "Software\\Mozilla\\GRE" subkey - this allows … … 438 442 // 439 443 strcpy(szKey, GRE_WIN_REG_LOC GRE_BUILD_ID); 440 444 441 445 if (::RegOpenKeyEx(HKEY_CURRENT_USER, szKey, 0, KEY_QUERY_VALUE, &hRegKey) == ERROR_SUCCESS) { 442 446 if (::RegQueryValueEx(hRegKey, "GreHome", NULL, NULL, (BYTE *)sGRELocation, &dwLength) != ERROR_SUCCESS) { … … 567 571 static char sXPCOMPath[MAXPATHLEN]; 568 572 569 extern "C" const char* 573 extern "C" const char* 570 574 GRE_GetXPCOMPath() 571 575 {
Note:
See TracChangeset
for help on using the changeset viewer.