From f1deefd73be767331dfafdc5f876427b37e0cb59 Mon Sep 17 00:00:00 2001 From: "dcamp@mozilla.com" Date: Wed, 27 Jun 2007 19:18:54 -0700 Subject: [PATCH] fix for unicode paths while writing out the submitted breakpad report file. b=382508, r=luser (last patch should have been "unblock signals on the crash reporter in linux. b=385532, r=luser") --- toolkit/airbag/client/crashreporter.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/toolkit/airbag/client/crashreporter.cpp b/toolkit/airbag/client/crashreporter.cpp index c0853106926..feb4ba77847 100644 --- a/toolkit/airbag/client/crashreporter.cpp +++ b/toolkit/airbag/client/crashreporter.cpp @@ -277,27 +277,29 @@ static bool AddSubmittedReport(const string& serverResponse) string path = submittedDir + UI_DIR_SEPARATOR + responseItems["CrashID"] + ".txt"; - ofstream file(path.c_str()); - if (!file.is_open()) + ofstream* file = UIOpenWrite(path); + if (!file->is_open()) { + delete file; return false; + } char buf[1024]; UI_SNPRINTF(buf, 1024, gStrings["CrashID"].c_str(), responseItems["CrashID"].c_str()); - file << buf << "\n"; + *file << buf << "\n"; if (responseItems.find("ViewURL") != responseItems.end()) { UI_SNPRINTF(buf, 1024, gStrings["CrashDetailsURL"].c_str(), responseItems["ViewURL"].c_str()); - file << buf << "\n"; + *file << buf << "\n"; } - file.close(); + file->close(); + delete file; return true; - } bool SendCompleted(bool success, const string& serverResponse)