]> diplodocus.org Git - nmh/blobdiff - sbr/readconfig.c
Redirected stderr to /dev/null in the test for presence of
[nmh] / sbr / readconfig.c
index b8b1b35753188290e715aad049ce47d033116f0a..b25ea99aa2f6f4c93e40c9c1ffbac1b5a22376ba 100644 (file)
@@ -52,15 +52,16 @@ readconfig (struct node **npp, FILE *ib, char *file, int ctx)
     char name[NAMESZ], field[BUFSIZ];
     register struct node *np;
     register struct procstr *ps;
+    m_getfld_state_t gstate = 0;
 
     if (npp == NULL && (npp = opp) == NULL) {
        admonish (NULL, "bug: readconfig called but pump not primed");
        return;
     }
 
-    for (state = FLD;;) {
+    for (;;) {
        int fieldsz = sizeof field;
-       switch (state = m_getfld (state, name, field, &fieldsz, ib)) {
+       switch (state = m_getfld (&gstate, name, field, &fieldsz, ib)) {
            case FLD:
            case FLDPLUS:
                np = (struct node *) mh_xmalloc (sizeof(*np));
@@ -71,7 +72,7 @@ readconfig (struct node **npp, FILE *ib, char *file, int ctx)
                    cp = getcpy (field);
                    while (state == FLDPLUS) {
                        fieldsz = sizeof field;
-                       state = m_getfld (state, name, field, &fieldsz, ib);
+                       state = m_getfld (&gstate, name, field, &fieldsz, ib);
                        cp = add (field, cp);
                    }
                    np->n_field = trimcpy (cp);
@@ -103,6 +104,7 @@ readconfig (struct node **npp, FILE *ib, char *file, int ctx)
        }
        break;
     }
+    m_getfld_state_destroy (&gstate);
 
     /*
      * Special handling for the pager processes: lproc and moreproc.