]> diplodocus.org Git - nmh/blobdiff - sbr/fmt_compile.c
mhshow: suppress error for undisplayable parts, if they're not wanted
[nmh] / sbr / fmt_compile.c
index 75adc08e2816f2286c41ebf6360ce025686304bc..3f170f313af7c5ec50ce2fc706436d623066b7f2 100644 (file)
@@ -364,11 +364,7 @@ compile_error(char *str, char *cp)
     usr_fstring[errpos] = '\0';
 
     for (i = errpos-errctx; i < errpos; i++) {
-#ifdef LOCALE
        if (iscntrl((unsigned char) usr_fstring[i]))
-#else
-       if (usr_fstring[i] < 32)
-#endif
            usr_fstring[i] = '_';
     }
 
@@ -1091,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
  */