# 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;