X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/7086ee95576e95aec1b54ad73c6fa6ead9186a3d..c9794733:/sbr/fmt_compile.c?ds=inline diff --git a/sbr/fmt_compile.c b/sbr/fmt_compile.c index 75adc08e..3f170f31 100644 --- a/sbr/fmt_compile.c +++ b/sbr/fmt_compile.c @@ -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 */