From fce16c18561d2dc589e81b7a38d05a5fc0009bd9 Mon Sep 17 00:00:00 2001 From: "yuwu@google.com" Date: Mon, 15 Jul 2013 18:33:10 +0000 Subject: [PATCH] Check env var BreakpadMinidumpLocation first, if set, use it as BREAKPAD_DUMP_DIRECTORY. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1201 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/ios/Breakpad.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/client/ios/Breakpad.mm b/src/client/ios/Breakpad.mm index e8c4240b..77f79ba9 100644 --- a/src/client/ios/Breakpad.mm +++ b/src/client/ios/Breakpad.mm @@ -327,8 +327,11 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) { NSString *urlStr = [parameters objectForKey:@BREAKPAD_URL]; NSString *vendor = [parameters objectForKey:@BREAKPAD_VENDOR]; - NSString *dumpSubdirectory = - [parameters objectForKey:@BREAKPAD_DUMP_DIRECTORY]; + // We check both parameters and the environment variable here. + char *envVarDumpSubdirectory = getenv(BREAKPAD_DUMP_DIRECTORY); + NSString *dumpSubdirectory = envVarDumpSubdirectory ? + [[NSString alloc] initWithUTF8String:envVarDumpSubdirectory] : + [parameters objectForKey:@BREAKPAD_DUMP_DIRECTORY]; NSDictionary *serverParameters = [parameters objectForKey:@BREAKPAD_SERVER_PARAMETER_DICT];