From 30c6ca6751d6e79f5042c82b23e7369dc2ebf20f Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 6 Oct 2016 09:14:16 -0700 Subject: [PATCH] Only call UTF8ToUTF16 on Windows --- atom/browser/api/atom_api_app.cc | 4 ++-- atom/common/crash_reporter/crash_reporter.cc | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index c3869c07fea7..5b3528002850 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -601,7 +601,7 @@ base::FilePath App::GetPath(mate::Arguments* args, const std::string& name) { if (key >= 0) succeed = PathService::Get(key, &path); if (!succeed) - args->ThrowError("Failed to get path"); + args->ThrowError("Failed to get '" + name + "' path"); return path; } @@ -609,7 +609,7 @@ void App::SetPath(mate::Arguments* args, const std::string& name, const base::FilePath& path) { if (!path.IsAbsolute()) { - args->ThrowError("path must be absolute"); + args->ThrowError("Path must be absolute"); return; } diff --git a/atom/common/crash_reporter/crash_reporter.cc b/atom/common/crash_reporter/crash_reporter.cc index 30b3852a6902..e6638ecccb1d 100644 --- a/atom/common/crash_reporter/crash_reporter.cc +++ b/atom/common/crash_reporter/crash_reporter.cc @@ -38,7 +38,12 @@ void CrashReporter::Start(const std::string& product_name, base::FilePath CrashReporter::GetCrashesDirectory( const std::string& product_name, const base::FilePath& temp_path) { - return temp_path.Append(base::UTF8ToUTF16(product_name + " Crashes")); + std::string folder_name = product_name + " Crashes"; +#if defined(OS_WIN) + return temp_path.Append(base::UTF8ToUTF16(folder_name)); +#else + return temp_path.Append(folder_name); +#endif } void CrashReporter::SetUploadParameters(const StringMap& parameters) {