Bug 1530103 - Check for osint argument when checking for greomni and appomni arguments. r=aklotz
authorRobert Strong <robert.bugzilla@gmail.com>
Wed, 27 Feb 2019 19:18:38 +0000
changeset 519425 537fb8251e616705a918541068782b04f9d8bee6
parent 519424 65c438efa01fc8478aa3d1d69bab22f758038b62
child 519426 60a25e3f7b506d87e9d6dcd9b171de8e558bdb1e
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaklotz
bugs1530103
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1530103 - Check for osint argument when checking for greomni and appomni arguments. r=aklotz Differential Revision: https://phabricator.services.mozilla.com/D21326
toolkit/xre/nsAppRunner.cpp
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -4982,36 +4982,42 @@ nsresult XRE_InitCommandLine(int aArgc, 
 
   for (int i = 0; i < aArgc; ++i) free(canonArgs[i]);
   delete[] canonArgs;
 #endif
 
   recordreplay::parent::InitializeUIProcess(gArgc, gArgv);
 
   const char* path = nullptr;
-  ArgResult ar = CheckArg("greomni", &path);
+  ArgResult ar = CheckArg("greomni", &path,
+                          CheckArgFlag::CheckOSInt | CheckArgFlag::RemoveArg);
   if (ar == ARG_BAD) {
     PR_fprintf(PR_STDERR,
-               "Error: argument --greomni requires a path argument\n");
+               "Error: argument --greomni requires a path argument or the "
+               "--osint argument was specified with the --appomni argument "
+               "which is invalid\n");
     return NS_ERROR_FAILURE;
   }
 
   if (!path) return rv;
 
   nsCOMPtr<nsIFile> greOmni;
   rv = XRE_GetFileFromPath(path, getter_AddRefs(greOmni));
   if (NS_FAILED(rv)) {
     PR_fprintf(PR_STDERR, "Error: argument --greomni requires a valid path\n");
     return rv;
   }
 
-  ar = CheckArg("appomni", &path);
+  ar = CheckArg("appomni", &path,
+                CheckArgFlag::CheckOSInt | CheckArgFlag::RemoveArg);
   if (ar == ARG_BAD) {
     PR_fprintf(PR_STDERR,
-               "Error: argument --appomni requires a path argument\n");
+               "Error: argument --appomni requires a path argument or the "
+               "--osint argument was specified with the --appomni argument "
+               "which is invalid\n");
     return NS_ERROR_FAILURE;
   }
 
   nsCOMPtr<nsIFile> appOmni;
   if (path) {
     rv = XRE_GetFileFromPath(path, getter_AddRefs(appOmni));
     if (NS_FAILED(rv)) {
       PR_fprintf(PR_STDERR,