mozilla-crashreporter-restart-args.patch
author Wolfgang Rosenauer <wr@rosenauer.org>
Thu, 14 Jun 2012 09:20:26 +0200
branchfirefox14
changeset 480 f99d16f8b0f5
parent 473 bfd820693349
child 483 6a8f38a81faf
child 486 83ef9ecabaeb
permissions -rw-r--r--
14.0b7

# HG changeset patch
# User Wolfgang Rosenauer <wr@rosenauer.org>
# Parent 2cea34f21fbbd778c9643f4453c8438719c27444
Bug 762780 - crashreporter fails to restart Firefox

diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -1364,29 +1364,22 @@ SetRestartArgs(int argc, char** argv)
 
   int i;
   nsCAutoString envVar;
   char *env;
   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
-    {
+    // Is there a request to suppress default binary launcher?
+    char* argv1 = getenv("MOZ_APP_LAUNCHER");
+    if(!argv1) {
       envVar += argv[i];
+    } else {
+      envVar += argv1;
     }
 
     // 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;