Fix buglet in Feature section and print original input F: lines.
authorMichael Poole <mdpoole@troilus.org>
Sat, 19 Nov 2005 23:55:14 +0000 (23:55 +0000)
committerMichael Poole <mdpoole@troilus.org>
Sat, 19 Nov 2005 23:55:14 +0000 (23:55 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1568 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/convert-conf.c

index 87df137b0a48a011ce1250cb916f7f4b8f2d4853..fa5a2e43bd537d74737025ce2ec1afb8ec840a0d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-11-19  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/convert-conf.c (finish_features): Only emit "Features {"
+       once in the converted configuration file.  Display the original
+       input line for each feature line in the output.
+
 2005-11-18  Michael Poole <mdpoole@troilus.org>
 
        * include/patchlevel.h (PATCHLEVEL): Update for pre05.
index 5505b3d26b432e43c02bc871440520011ec3d994..dbf4d58f948f93da2d1cf16765c298e05de5472b 100644 (file)
@@ -111,6 +111,14 @@ struct string_list {
     char value[1];
 };
 
+/** Find or insert the element from \a list that contains \a value.
+ * If an element of \a list already contains \a value, return it.
+ * Otherwise, append a new element to \a list containing \a value and
+ * return it.
+ * @param[in,out] list A list of strings.
+ * @param[in] value A string to search for.
+ * @return A string list element from \a list containing \a value.
+ */
 static struct string_list *string_get(struct string_list **list, const char *value)
 {
     struct string_list *curr;
@@ -309,10 +317,15 @@ static void finish_features(void)
     struct feature *feat;
     size_t ii;
 
-    fputs("Features {\n\t\"OPLEVELS\" = \"FALSE\";\n", stdout);
-    fputs("Features {\n\t\"ZANNELS\" = \"FALSE\";\n", stdout);
+    fputs("Features {\n", stdout);
+    fputs("\t\"OPLEVELS\" = \"FALSE\";\n", stdout);
+    fputs("\t\"ZANNELS\" = \"FALSE\";\n", stdout);
 
     for (feat = features; feat; feat = feat->next) {
+        /* Display the original feature line we are talking about. */
+        for (sl = feat->origins; sl; sl = sl->next)
+            fprintf(stdout, "# %s\n", sl->value);
+
         /* See if the feature was remapped to an oper privilege. */
         for (rmf = remapped_features; rmf->name; rmf++)
             if (0 == strcmp(feat->name, rmf->name))