Bug 1076977: Get crashreporter to work with the new v2 bundle structure on OSX. r=bsmedberg
authorStephen Pohl <spohl.mozilla.bugs@gmail.com>
Fri, 03 Oct 2014 10:29:38 -0400
changeset 208706 4e05fcdee48f8a54dc27ca4e11ec66e70896fa9a
parent 208705 7a45d556f280831c80ec0d510e4b91160955ae66
child 208707 d5290c0ca86ee534fb836a9b6255128a3bed22db
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbsmedberg
bugs1076977
milestone35.0a1
Bug 1076977: Get crashreporter to work with the new v2 bundle structure on OSX. r=bsmedberg
toolkit/crashreporter/client/crashreporter_osx.mm
--- a/toolkit/crashreporter/client/crashreporter_osx.mm
+++ b/toolkit/crashreporter/client/crashreporter_osx.mm
@@ -802,19 +802,24 @@ void UIError_impl(const string& message)
   }
 
   [gUI showErrorUI: message];
   [NSApp run];
 }
 
 bool UIGetIniPath(string& path)
 {
-  path = gArgv[0];
-  path.append(".ini");
-
+  NSString* tmpPath = [NSString stringWithUTF8String:gArgv[0]];
+  NSString* iniName = [tmpPath lastPathComponent];
+  iniName = [iniName stringByAppendingPathExtension:@"ini"];
+  tmpPath = [tmpPath stringByDeletingLastPathComponent];
+  tmpPath = [tmpPath stringByDeletingLastPathComponent];
+  tmpPath = [tmpPath stringByAppendingPathComponent:@"Resources"];
+  tmpPath = [tmpPath stringByAppendingPathComponent:iniName];
+  path = [tmpPath UTF8String];
   return true;
 }
 
 bool UIGetSettingsPath(const string& vendor,
                        const string& product,
                        string& settingsPath)
 {
   FSRef foundRef;