[tor-commits] [tor/master] Merge remote-tracking branch 'public/bug13397'
nickm at torproject.org
nickm at torproject.org
Thu Jan 15 12:42:48 UTC 2015
commit 3668a4126e0c2502a77c2ba5d7885add489a964a
Merge: 1686f81 b06b783
Author: Nick Mathewson <nickm at torproject.org>
Date: Wed Jan 14 14:15:29 2015 -0500
Merge remote-tracking branch 'public/bug13397'
changes/bug13397 | 4 ++++
src/or/config.c | 20 +++++++++-----------
2 files changed, 13 insertions(+), 11 deletions(-)
diff --cc src/or/config.c
index 5db065f,cf42f30..982cb2e
--- a/src/or/config.c
+++ b/src/or/config.c
@@@ -4221,17 -4147,19 +4216,20 @@@ load_torrc_from_disk(config_line_t *cmd
int ignore_missing_torrc = 0;
char **fname_var = defaults_file ? &torrc_defaults_fname : &torrc_fname;
- fname = find_torrc_filename(cmd_arg, defaults_file,
- &using_default_torrc, &ignore_missing_torrc);
- tor_assert(fname);
+ if (*fname_var == NULL) {
+ fname = find_torrc_filename(cmd_arg, defaults_file,
+ &using_default_torrc, &ignore_missing_torrc);
+ tor_assert(fname);
+ tor_free(*fname_var);
+ *fname_var = fname;
+ } else {
+ fname = *fname_var;
+ }
log_debug(LD_CONFIG, "Opening config file \"%s\"", fname);
- tor_free(*fname_var);
- *fname_var = fname;
-
/* Open config file */
- if (file_status(fname) != FN_FILE ||
+ file_status_t st = file_status(fname);
+ if (!(st == FN_FILE || st == FN_EMPTY) ||
!(cf = read_file_to_str(fname,0,NULL))) {
if (using_default_torrc == 1 || ignore_missing_torrc) {
if (!defaults_file)
More information about the tor-commits
mailing list