Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2750)

Unified Diff: base/mime_util_xdg.cc

Issue 2919005: Use file_util::GetHomeDir instead of getenv("HOME"). (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/nss_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mime_util_xdg.cc
diff --git a/base/mime_util_xdg.cc b/base/mime_util_xdg.cc
index 3f6227e0189f0d4f45dd56a4cd03e18fa6672956..d00a568a3142816b22ff0a07d2a4d0b67c984762 100644
--- a/base/mime_util_xdg.cc
+++ b/base/mime_util_xdg.cc
@@ -396,8 +396,8 @@ void AddXDGDataDir(const FilePath& dir) {
// Add all the xdg icon directories.
void InitIconDir() {
Singleton<MimeUtilConstants>::get()->icon_dirs_->clear();
- const char* home = getenv("HOME");
- if (home) {
+ FilePath home = file_util::GetHomeDir();
+ if (!home.empty()) {
FilePath legacy_data_dir(home);
legacy_data_dir = legacy_data_dir.AppendASCII(".icons");
if (file_util::DirectoryExists(legacy_data_dir))
@@ -406,7 +406,7 @@ void InitIconDir() {
const char* env = getenv("XDG_DATA_HOME");
if (env) {
AddXDGDataDir(FilePath(env));
- } else if (home) {
+ } else if (!home.empty()) {
FilePath local_data_dir(home);
local_data_dir = local_data_dir.AppendASCII(".local");
local_data_dir = local_data_dir.AppendASCII("share");
« no previous file with comments | « no previous file | base/nss_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698