mozilla-crashreporter-restart-args.patch
changeset 469 26e68edfc24b
child 483 6a8f38a81faf
child 486 83ef9ecabaeb
equal deleted inserted replaced
468:22a70eb49a43 469:26e68edfc24b
       
     1 # HG changeset patch
       
     2 # User Wolfgang Rosenauer <wr@rosenauer.org>
       
     3 # Parent 2cea34f21fbbd778c9643f4453c8438719c27444
       
     4 Bug 762780 - crashreporter fails to restart Firefox
       
     5 
       
     6 diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp
       
     7 --- a/toolkit/crashreporter/nsExceptionHandler.cpp
       
     8 +++ b/toolkit/crashreporter/nsExceptionHandler.cpp
       
     9 @@ -1364,29 +1364,22 @@ SetRestartArgs(int argc, char** argv)
       
    10  
       
    11    int i;
       
    12    nsCAutoString envVar;
       
    13    char *env;
       
    14    for (i = 0; i < argc; i++) {
       
    15      envVar = "MOZ_CRASHREPORTER_RESTART_ARG_";
       
    16      envVar.AppendInt(i);
       
    17      envVar += "=";
       
    18 -#if defined(XP_UNIX) && !defined(XP_MACOSX)
       
    19 -    // we'd like to run the script around the binary
       
    20 -    // instead of the binary itself, so remove the -bin
       
    21 -    // if it exists on the first argument
       
    22 -    int arg_len = 0;
       
    23 -    if (i == 0 &&
       
    24 -        (arg_len = strlen(argv[i])) > 4 &&
       
    25 -        strcmp(argv[i] + arg_len - 4, "-bin") == 0) {
       
    26 -      envVar.Append(argv[i], arg_len - 4);
       
    27 -    } else
       
    28 -#endif
       
    29 -    {
       
    30 +    // Is there a request to suppress default binary launcher?
       
    31 +    char* argv1 = getenv("MOZ_APP_LAUNCHER");
       
    32 +    if(!argv1) {
       
    33        envVar += argv[i];
       
    34 +    } else {
       
    35 +      envVar += argv1;
       
    36      }
       
    37  
       
    38      // PR_SetEnv() wants the string to be available for the lifetime
       
    39      // of the app, so dup it here
       
    40      env = ToNewCString(envVar);
       
    41      if (!env)
       
    42        return NS_ERROR_OUT_OF_MEMORY;
       
    43