зеркало из https://github.com/mozilla/pjs.git
Bug 588911: Initialize gArgc/v earlier in XRE_InitParentProcess(). r=bent a=test-only
This commit is contained in:
Родитель
c698401705
Коммит
73d06dd06e
|
@ -470,6 +470,8 @@ static void RemoveArg(char **argv)
|
||||||
static ArgResult
|
static ArgResult
|
||||||
CheckArg(const char* aArg, PRBool aCheckOSInt = PR_FALSE, const char **aParam = nsnull, PRBool aRemArg = PR_TRUE)
|
CheckArg(const char* aArg, PRBool aCheckOSInt = PR_FALSE, const char **aParam = nsnull, PRBool aRemArg = PR_TRUE)
|
||||||
{
|
{
|
||||||
|
NS_ABORT_IF_FALSE(gArgv, "gArgv must be initialized before CheckArg()");
|
||||||
|
|
||||||
char **curarg = gArgv + 1; // skip argv[0]
|
char **curarg = gArgv + 1; // skip argv[0]
|
||||||
ArgResult ar = ARG_NONE;
|
ArgResult ar = ARG_NONE;
|
||||||
|
|
||||||
|
|
|
@ -492,7 +492,9 @@ XRE_InitParentProcess(int aArgc,
|
||||||
NS_ENSURE_ARG_POINTER(aArgv);
|
NS_ENSURE_ARG_POINTER(aArgv);
|
||||||
NS_ENSURE_ARG_POINTER(aArgv[0]);
|
NS_ENSURE_ARG_POINTER(aArgv[0]);
|
||||||
|
|
||||||
int rv = XRE_InitCommandLine(aArgc, aArgv);
|
gArgc = aArgc;
|
||||||
|
gArgv = aArgv;
|
||||||
|
int rv = XRE_InitCommandLine(gArgc, gArgv);
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче