aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/or/config.c b/src/or/config.c
index dc2a1ec2b0..6ce47263bd 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -945,10 +945,13 @@ const char *get_data_directory(or_options_t *options) {
const char *d;
if (options->DataDirectory)
d = options->DataDirectory;
- else
+ else if (server_mode())
d = "~/.tor";
+ else
+ d = NULL; /* XXX008 don't create datadir until we have something
+ we'll be putting in it */
- if (strncmp(d,"~/",2)==0) {
+ if (d && strncmp(d,"~/",2)==0) {
char *fn = expand_filename(d);
tor_free(options->DataDirectory);
options->DataDirectory = fn;