summaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2010-06-07 02:18:01 +0200
committerSebastian Hahn <sebastian@torproject.org>2010-06-07 02:18:01 +0200
commit0882e1e839d5023fc6f0dbd11eb6e45236f3dc75 (patch)
tree68a6af7d5c2fd89844d65ff53ea17a6a4d73bde7 /src/common/util.c
parentfaf51fa52a7462e356927ac521ff4e6ee0703d7c (diff)
downloadtor-0882e1e839d5023fc6f0dbd11eb6e45236f3dc75.tar.gz
tor-0882e1e839d5023fc6f0dbd11eb6e45236f3dc75.zip
Treat unset $HOME like empty $HOME
This means Tor no longer dies when it doesn't have a $HOME.
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/common/util.c b/src/common/util.c
index fe48e93284..748e23bab1 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -2323,12 +2323,10 @@ expand_filename(const char *filename)
if (filename[1] == '/' || filename[1] == '\0') {
home = getenv("HOME");
- if (!home) {
- log_warn(LD_CONFIG, "Couldn't find $HOME environment variable while "
- "expanding \"%s\"", filename);
- return NULL;
- }
- home = tor_strdup(home);
+ if (!home)
+ home = tor_strdup("");
+ else
+ home = tor_strdup(home);
rest = strlen(filename)>=2?(filename+2):"";
} else {
#ifdef HAVE_PWD_H