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

Unified Diff: base/nss_util.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 | « base/mime_util_xdg.cc ('k') | chrome/browser/importer/firefox_importer_utils_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/nss_util.cc
diff --git a/base/nss_util.cc b/base/nss_util.cc
index 927f1abd0e0b46bc9b5c89883f8e77e4fb3a9f16..14c27af249ce849169f07cee3f59c1cd2339cccd 100644
--- a/base/nss_util.cc
+++ b/base/nss_util.cc
@@ -34,16 +34,16 @@ namespace {
#if !defined(USE_NSS_FOR_SSL_ONLY)
std::string GetDefaultConfigDirectory() {
- const char* home = getenv("HOME");
- if (home == NULL) {
+ FilePath home = file_util::GetHomeDir();
+ if (home.empty()) {
LOG(ERROR) << "$HOME is not set.";
- return "";
+ return std::string();
}
FilePath dir(home);
dir = dir.AppendASCII(".pki").AppendASCII("nssdb");
if (!file_util::CreateDirectory(dir)) {
LOG(ERROR) << "Failed to create ~/.pki/nssdb directory.";
- return "";
+ return std::string();
}
return dir.value();
}
« no previous file with comments | « base/mime_util_xdg.cc ('k') | chrome/browser/importer/firefox_importer_utils_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698