- int binary; /* binary character found flag */
- int c; /* current character */
- char *content_type; /* mime content type */
- FILE *fp; /* content and pipe file pointer */
- struct node *np; /* context scan node pointer */
- char *p; /* miscellaneous string pointer */
-
- content_type = NULL;
-
- /*
- ** Check the file name for a suffix. Scan the context for that
- ** suffix on a mhshow-suffix- entry. We use these entries to
- ** be compatible with mhshow, and there's no reason to make the
- ** user specify each suffix twice. Context entries of the form
- ** "mhshow-suffix-contenttype" in the name have the suffix in
- ** the field, including the dot.
- */
-
- if ((p = strrchr(file_name, '.')) != NULL) {
- for (np = m_defs; np; np = np->n_next) {
- if (strncasecmp(np->n_name, "mhshow-suffix-", 14) == 0
- && mh_strcasecmp(p, np->n_field) == 0)
- {
- content_type = np->n_name + 14;
- break;
- }
+ FILE *fp;
+ struct node *np;
+ char *cp;
+ char content_type[BUFSIZ];
+ char cmdbuf[BUFSIZ];
+ char *cmd = mimetypequeryproc;
+
+ for (np = m_defs; np; np = np->n_next) {
+ if (strcasecmp(np->n_name, mimetypequery)==0) {
+ cmd = np->n_field;
+ break;