Bug 1243603 - Post: Remove useless -osint checks. r=Gijs

[`EnsureCommandLineSafe`](https://searchfox.org/mozilla-central/rev/ead7da2d9c5400bc7034ff3f06a030531bd7e5b9/toolkit/xre/CmdLineAndEnvUtils.h#196)
doesn't allow `-p` with `-osint`, so these checks are useless.

Differential Revision: https://phabricator.services.mozilla.com/D132543
This commit is contained in:
Nick Alexander 2021-12-11 00:00:55 +00:00
parent 969b4ce42e
commit 6cacac0089

View File

@ -1450,25 +1450,9 @@ nsresult nsToolkitProfileService::SelectStartupProfile(
// uses that named profile or without a name it opens the profile manager.
ar = CheckArg(*aArgc, aArgv, "p", &arg);
if (ar == ARG_BAD) {
ar = CheckArg(*aArgc, aArgv, "osint");
if (ar == ARG_FOUND) {
PR_fprintf(
PR_STDERR,
"Error: argument -p is invalid when argument --osint is specified\n");
return NS_ERROR_FAILURE;
}
return NS_ERROR_SHOW_PROFILE_MANAGER;
}
if (ar) {
ar = CheckArg(*aArgc, aArgv, "osint");
if (ar == ARG_FOUND) {
PR_fprintf(
PR_STDERR,
"Error: argument -p is invalid when argument --osint is specified\n");
return NS_ERROR_FAILURE;
}
rv = GetProfileByName(nsDependentCString(arg), getter_AddRefs(mCurrent));
if (NS_SUCCEEDED(rv)) {
mStartupReason = u"argument-p"_ns;