mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 01:08:39 +09:00
Issue #1441 - Guard appomni/greomni with UXP_CUSTOM_OMNI env var.
This commit is contained in:
parent
088c5a329d
commit
e58f92ba6e
1 changed files with 38 additions and 34 deletions
|
|
@ -4139,45 +4139,49 @@ XRE_InitCommandLine(int aArgc, char* aArgv[])
|
|||
delete[] canonArgs;
|
||||
#endif
|
||||
|
||||
const char *path = nullptr;
|
||||
ArgResult ar = CheckArg("greomni", true, &path);
|
||||
if (ar == ARG_BAD) {
|
||||
PR_fprintf(PR_STDERR,
|
||||
"Error: argument --greomni requires a path argument or the "
|
||||
"--osint argument was specified with the --greomni argument "
|
||||
"which is invalid.\n");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
if (PR_GetEnv("UXP_CUSTOM_OMNI")) {
|
||||
// Process CLI parameters for specifying custom omnijars
|
||||
const char *path = nullptr;
|
||||
ArgResult ar = CheckArg("greomni", true, &path);
|
||||
if (ar == ARG_BAD) {
|
||||
PR_fprintf(PR_STDERR,
|
||||
"Error: argument --greomni requires a path argument or the "
|
||||
"--osint argument was specified with the --greomni argument "
|
||||
"which is invalid.\n");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (!path)
|
||||
return rv;
|
||||
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;
|
||||
}
|
||||
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", true, &path);
|
||||
if (ar == ARG_BAD) {
|
||||
PR_fprintf(PR_STDERR,
|
||||
"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;
|
||||
}
|
||||
ar = CheckArg("appomni", true, &path);
|
||||
if (ar == ARG_BAD) {
|
||||
PR_fprintf(PR_STDERR,
|
||||
"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, "Error: argument --appomni requires a valid path\n");
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
nsCOMPtr<nsIFile> appOmni;
|
||||
if (path) {
|
||||
rv = XRE_GetFileFromPath(path, getter_AddRefs(appOmni));
|
||||
if (NS_FAILED(rv)) {
|
||||
PR_fprintf(PR_STDERR, "Error: argument --appomni requires a valid path\n");
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
mozilla::Omnijar::Init(greOmni, appOmni);
|
||||
} // UXP_CUSTOM_OMNI
|
||||
|
||||
mozilla::Omnijar::Init(greOmni, appOmni);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue