From afb015357dd0011a4384c4adfcd24e5dcac877cc Mon Sep 17 00:00:00 2001 From: "pavlov%netscape.com" Date: Sat, 12 Feb 2000 04:47:38 +0000 Subject: [PATCH] fix viewer bustage on linux r=bryner git-svn-id: svn://10.0.0.236/trunk@60584 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpfe/appshell/src/nsCommandLineService.cpp | 10 ++++++++++ .../components/startup/src/nsCommandLineService.cpp | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/mozilla/xpfe/appshell/src/nsCommandLineService.cpp b/mozilla/xpfe/appshell/src/nsCommandLineService.cpp index 6b25bccc911..b43c552d46e 100644 --- a/mozilla/xpfe/appshell/src/nsCommandLineService.cpp +++ b/mozilla/xpfe/appshell/src/nsCommandLineService.cpp @@ -211,6 +211,11 @@ nsCmdLineService::GetArgc(PRInt32 * aResult) if (nsnull == aResult) return NS_ERROR_NULL_POINTER; + + // if we are null, we were never initialized. + if (mArgc == 0) + return NS_ERROR_FAILURE; + *aResult = mArgc; return NS_OK; } @@ -220,6 +225,11 @@ nsCmdLineService::GetArgv(char *** aResult) { if (nsnull == aResult) return NS_ERROR_NULL_POINTER; + + // if we are 0, we were never set. + if (!mArgv) + return NS_ERROR_FAILURE; + *aResult = mArgv; return NS_OK; diff --git a/mozilla/xpfe/components/startup/src/nsCommandLineService.cpp b/mozilla/xpfe/components/startup/src/nsCommandLineService.cpp index 6b25bccc911..b43c552d46e 100644 --- a/mozilla/xpfe/components/startup/src/nsCommandLineService.cpp +++ b/mozilla/xpfe/components/startup/src/nsCommandLineService.cpp @@ -211,6 +211,11 @@ nsCmdLineService::GetArgc(PRInt32 * aResult) if (nsnull == aResult) return NS_ERROR_NULL_POINTER; + + // if we are null, we were never initialized. + if (mArgc == 0) + return NS_ERROR_FAILURE; + *aResult = mArgc; return NS_OK; } @@ -220,6 +225,11 @@ nsCmdLineService::GetArgv(char *** aResult) { if (nsnull == aResult) return NS_ERROR_NULL_POINTER; + + // if we are 0, we were never set. + if (!mArgv) + return NS_ERROR_FAILURE; + *aResult = mArgv; return NS_OK;