- int state;
- char *cp, seqfile[PATH_MAX];
- char name[NAMESZ], field[BUFSIZ];
- FILE *fp;
-
- /*
- * If mh_seq == NULL (such as if nmh been compiled with
- * NOPUBLICSEQ), or if *mh_seq == '\0' (the user has defined
- * the "mh-sequences" profile entry, but left it empty),
- * then just return, and do not initialize any public sequences.
- */
- if (mh_seq == NULL || *mh_seq == '\0')
- return;
-
- /* get filename of sequence file */
- snprintf (seqfile, sizeof(seqfile), "%s/%s", mp->foldpath, mh_seq);
-
- if ((fp = lkfopen (seqfile, "r")) == NULL)
- return;
-
- /* Use m_getfld to scan sequence file */
- for (state = FLD;;) {
- switch (state = m_getfld (state, name, field, sizeof(field), fp)) {
- case FLD:
- case FLDPLUS:
- case FLDEOF:
- if (state == FLDPLUS) {
- cp = getcpy (field);
- while (state == FLDPLUS) {
- state = m_getfld (state, name, field, sizeof(field), fp);
- cp = add (field, cp);
- }
- seq_init (mp, getcpy (name), trimcpy (cp));
- free (cp);
- } else {
- seq_init (mp, getcpy (name), trimcpy (field));
+ int state;
+ char *cp, seqfile[PATH_MAX];
+ char name[NAMESZ], field[BUFSIZ];
+ FILE *fp;
+
+ /*
+ ** If public sequences are disabled (e.g. the user has defined
+ ** an empty `Mh-Sequences' profile entry), then just return.
+ */
+ if (mh_seq == NULL || *mh_seq == '\0')
+ return;
+
+ /* get filename of sequence file */
+ snprintf(seqfile, sizeof(seqfile), "%s/%s", mp->foldpath, mh_seq);
+
+ if ((fp = lkfopen(seqfile, "r")) == NULL)
+ return;
+
+ /* Use m_getfld to scan sequence file */
+ for (state = FLD;;) {
+ switch (state = m_getfld(state, name, field, sizeof(field),
+ fp)) {
+ case FLD:
+ case FLDPLUS:
+ case FLDEOF:
+ if (state == FLDPLUS) {
+ cp = getcpy(field);
+ while (state == FLDPLUS) {
+ state = m_getfld(state, name, field,
+ sizeof(field), fp);
+ cp = add(field, cp);
+ }
+ seq_init(mp, getcpy(name), trimcpy(cp));
+ free(cp);
+ } else {
+ seq_init(mp, getcpy(name), trimcpy(field));
+ }
+ if (state == FLDEOF)
+ break;
+ continue;
+
+ case BODY:
+ case BODYEOF:
+ adios(EX_CONFIG, NULL, "no blank lines are permitted in %s",
+ seqfile);
+ /* fall */
+
+ case FILEEOF:
+ break;
+
+ default:
+ adios(EX_CONFIG, NULL, "%s is poorly formatted", seqfile);