зеркало из https://github.com/mozilla/pjs.git
Bug 316857 - in win/unix stub, allow finding a private XULRunner in the "xulrunner" subdirectory, r=darin
This commit is contained in:
Родитель
72781fc64e
Коммит
ed858c5347
|
@ -42,10 +42,12 @@
|
|||
|
||||
#ifdef XP_WIN
|
||||
#include <windows.h>
|
||||
#include <io.h>
|
||||
#define snprintf _snprintf
|
||||
#define PATH_SEPARATOR_CHAR '\\'
|
||||
#define XULRUNNER_BIN "xulrunner.exe"
|
||||
#include "nsWindowsRestart.cpp"
|
||||
#define R_OK 04
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -110,7 +112,14 @@ main(int argc, char **argv)
|
|||
if (!lastSlash)
|
||||
return 1;
|
||||
|
||||
strcpy(lastSlash + 1, "application.ini");
|
||||
*(++lastSlash) = '\0';
|
||||
|
||||
char greDir[MAXPATHLEN];
|
||||
snprintf(greDir, sizeof(greDir),
|
||||
"%sxulrunner" XPCOM_FILE_PATH_SEPARATOR XPCOM_DLL,
|
||||
iniPath);
|
||||
|
||||
strncpy(lastSlash, "application.ini", sizeof(iniPath) - (lastSlash - iniPath));
|
||||
|
||||
nsINIParser parser;
|
||||
rv = parser.Init(iniPath);
|
||||
|
@ -119,7 +128,7 @@ main(int argc, char **argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
char greDir[MAXPATHLEN];
|
||||
if (access(greDir, R_OK) != 0) {
|
||||
char minVersion[VERSION_MAXLEN];
|
||||
|
||||
// If a gecko maxVersion is not specified, we assume that the app uses only
|
||||
|
@ -155,6 +164,7 @@ main(int argc, char **argv)
|
|||
range.lower, range.upper);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
lastSlash = strrchr(greDir, PATH_SEPARATOR_CHAR);
|
||||
if (lastSlash) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче