]>
diplodocus.org Git - nmh/blob - sbr/context_del.c
3 * context_del.c -- delete an entry from the context/profile list
5 * This code is Copyright (c) 2002, by the authors of nmh. See the
6 * COPYRIGHT file in the root directory of the nmh distribution for
7 * complete copyright information.
14 * Delete a key/value pair from the context/profile list.
15 * Return 0 if key is found, else return 1.
19 context_del (char *key
)
23 for (np
= m_defs
, pp
= NULL
; np
; pp
= np
, np
= np
->n_next
) {
24 if (!strcasecmp (np
->n_name
? np
->n_name
: "", key
? key
: "")) {
26 admonish (NULL
, "bug: context_del(key=\"%s\")", np
->n_name
);
28 pp
->n_next
= np
->n_next
;
32 mh_xfree(np
->n_field
);