2012-07-16 10:13:51 +02:00
|
|
|
# HG changeset patch
|
|
|
|
# User Wolfgang Rosenauer <wr@rosenauer.org>
|
2012-08-28 20:40:50 +02:00
|
|
|
# Parent 07bb4ecfd6d6cc16360e7a32ee10b885d523f20d
|
2012-07-16 10:13:51 +02:00
|
|
|
Bug 762780 - crashreporter restart command should support MOZ_APP_LAUNCHER
|
|
|
|
|
|
|
|
diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp
|
|
|
|
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
|
|
|
|
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
|
2012-08-28 20:40:50 +02:00
|
|
|
@@ -1360,32 +1360,25 @@ nsresult
|
2012-07-16 10:13:51 +02:00
|
|
|
SetRestartArgs(int argc, char** argv)
|
|
|
|
{
|
|
|
|
if (!gExceptionHandler)
|
|
|
|
return NS_OK;
|
|
|
|
|
|
|
|
int i;
|
|
|
|
nsCAutoString envVar;
|
|
|
|
char *env;
|
|
|
|
+ char *argv1 = getenv("MOZ_APP_LAUNCHER");
|
|
|
|
for (i = 0; i < argc; i++) {
|
|
|
|
envVar = "MOZ_CRASHREPORTER_RESTART_ARG_";
|
|
|
|
envVar.AppendInt(i);
|
|
|
|
envVar += "=";
|
|
|
|
-#if defined(XP_UNIX) && !defined(XP_MACOSX)
|
|
|
|
- // we'd like to run the script around the binary
|
|
|
|
- // instead of the binary itself, so remove the -bin
|
|
|
|
- // if it exists on the first argument
|
|
|
|
- int arg_len = 0;
|
|
|
|
- if (i == 0 &&
|
|
|
|
- (arg_len = strlen(argv[i])) > 4 &&
|
|
|
|
- strcmp(argv[i] + arg_len - 4, "-bin") == 0) {
|
|
|
|
- envVar.Append(argv[i], arg_len - 4);
|
|
|
|
- } else
|
|
|
|
-#endif
|
|
|
|
- {
|
|
|
|
+ if (argv1 && i == 0) {
|
|
|
|
+ // Is there a request to suppress default binary launcher?
|
|
|
|
+ envVar += argv1;
|
|
|
|
+ } else {
|
|
|
|
envVar += argv[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
// PR_SetEnv() wants the string to be available for the lifetime
|
|
|
|
// of the app, so dup it here
|
|
|
|
env = ToNewCString(envVar);
|
|
|
|
if (!env)
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|