]> diplodocus.org Git - nmh/blobdiff - sbr/fmt_compile.c
If getln() sees a newline as its first character, it incorrectly
[nmh] / sbr / fmt_compile.c
index 970e71e5abd3d489bd7f66ff765c32b37670bcd8..3f170f313af7c5ec50ce2fc706436d623066b7f2 100644 (file)
@@ -1087,6 +1087,25 @@ fmt_appendcomp(int bucket, char *component, char *text)
     }
 }
 
+/*
+ * Iterate over our component hash table
+ */
+
+struct comp *
+fmt_nextcomp(struct comp *comp, unsigned int *bucket)
+{
+    if (comp == NULL)
+       *bucket = 0;
+    else
+       comp = comp->c_next;
+
+    while (comp == NULL && *bucket < sizeof(wantcomp)/sizeof(wantcomp[0])) {
+       comp = wantcomp[(*bucket)++];
+    }
+
+    return comp;
+}
+
 /*
  * Free and reset our component hash table
  */