[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Fix bug 240: dont dump descriptions when not dumping actual...



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv24580/src/or

Modified Files:
	config.c 
Log Message:
Fix bug 240: dont dump descriptions when not dumping actual config lines.

Index: config.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.489
retrieving revision 1.490
diff -u -p -d -r1.489 -r1.490
--- config.c	11 Jan 2006 19:40:14 -0000	1.489
+++ config.c	11 Jan 2006 19:43:14 -0000	1.490
@@ -1701,14 +1701,16 @@ config_dump(config_format_t *fmt, void *
       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;