]> khamidou — GitHub mirrors - electron.git/commitdiff
Fixes for windows
authorCorne Dorrestijn <contact@corne.info>
Wed, 13 Aug 2014 12:16:55 +0000 (14:16 +0200)
committerCorne Dorrestijn <contact@corne.info>
Wed, 13 Aug 2014 12:16:55 +0000 (14:16 +0200)
atom/browser/api/atom_api_app.cc

index 19e6e677b4b82719a031606e628f92d0981728fd..17ce3435882c66e743c228c129cfe43d44adfb25 100644 (file)
@@ -78,9 +78,16 @@ std::string App::GetDataPath() {
   CHECK(PathService::Get(base::DIR_APP_DATA, &path));
 #endif
 
-  base::FilePath dataPath = path.Append(base::FilePath::FromUTF8Unsafe(Browser::Get()->GetName()));
+  base::FilePath data_path = path.Append(
+    base::FilePath::FromUTF8Unsafe(Browser::Get()->GetName()));
 
-  return dataPath.value();
+  // FilePath.value() returns a std::wstring in windows and 
+  // std::string on other platforms.
+  std::vector<char> writable(data_path.value().begin(),
+    data_path.value().end());
+  writable.push_back('\0');
+
+  return &writable[0];
 }
 
 mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(