diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-01-11 19:43:14 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-01-11 19:43:14 +0000 |
commit | adbe0f0adaf488461438e65e654dddfab8e9a777 (patch) | |
tree | 2b5e40b8755f0c59df08eb6b04342bc3b3972e34 | |
parent | 099b9ce2f9d28e36628f26b465fe52eec4fa59ac (diff) | |
download | tor-adbe0f0adaf488461438e65e654dddfab8e9a777.tar.gz tor-adbe0f0adaf488461438e65e654dddfab8e9a777.zip |
Fix bug 240: dont dump descriptions when not dumping actual config lines.
svn:r5804
-rw-r--r-- | src/or/config.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/config.c b/src/or/config.c index 67d9bc8858..01e4041d10 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1701,14 +1701,16 @@ config_dump(config_format_t *fmt, void *options, int minimal) continue; desc = config_find_description(fmt, fmt->vars[i].name); - if (desc) { + line = assigned = get_assigned_option(fmt, options, fmt->vars[i].name); + + if (line && desc) { + /* Only dump the description if there's something to describe. */ size_t len = strlen(desc)+8; char *tmp = tor_malloc(len); tor_snprintf(tmp, len, "# %s\n",desc); smartlist_add(elements, tmp); } - line = assigned = get_assigned_option(fmt, options, fmt->vars[i].name); for (; line; line = line->next) { size_t len = strlen(line->key) + strlen(line->value) + 3; char *tmp; |