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:30:07 -0400
changeset 491318 16dd6a108ff8cd665c9ed4e9b337a6a93c706edf
parent 491316 ebf3623173cf27141a63305b95583474c7e3fd84
child 491319 f38d74b29015725c5b20de96cf75d75fa53aca97
push id47343
push userbmo:dothayer@mozilla.com
push dateWed, 01 Mar 2017 22:58:58 +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;