Bug 386959 - crashreporter gets wrong restart arguments for xulrunner apps, r=bsmedberg

This commit is contained in:
wr@rosenauer.org 2007-07-24 18:06:12 -07:00
parent e99073ff83
commit b91f78af35
2 changed files with 24 additions and 0 deletions

View File

@ -434,6 +434,21 @@ int main(int argc, char** argv)
// we don't need to actually send this
queryParameters.erase("ServerURL");
// re-set XUL_APP_FILE for xulrunner wrapped apps
const char *appfile = getenv("MOZ_CRASHREPORTER_RESTART_XUL_APP_FILE");
if (appfile && *appfile) {
const char prefix[] = "XUL_APP_FILE=";
char *env = (char*) malloc(strlen(appfile)+strlen(prefix));
if (!env) {
UIError("Out of memory");
return 0;
}
strcpy(env, prefix);
strcat(env, appfile);
putenv(env);
free(env);
}
vector<string> restartArgs;
ostringstream paramName;

View File

@ -470,6 +470,15 @@ SetRestartArgs(int argc, char **argv)
PR_SetEnv(env);
// make sure we save the info in XUL_APP_FILE for the reporter
const char *appfile = PR_GetEnv("XUL_APP_FILE");
if (appfile && *appfile) {
envVar = "MOZ_CRASHREPORTER_RESTART_XUL_APP_FILE=";
envVar += appfile;
env = ToNewCString(envVar);
PR_SetEnv(env);
}
return NS_OK;
}
} // namespace CrashReporter