mozilla-crashreporter-restart-args.patch
author Wolfgang Rosenauer <wr@rosenauer.org>
Thu, 19 Jul 2012 20:44:57 +0200
changeset 506 f02147953485
parent 483 6a8f38a81faf
permissions -rw-r--r--
merged updates from firefox14

# HG changeset patch
# User Wolfgang Rosenauer <wr@rosenauer.org>
# Parent 07bb4ecfd6d6cc16360e7a32ee10b885d523f20d
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
@@ -1360,32 +1360,25 @@ nsresult
 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;