]>
diplodocus.org Git - nmh/blob - uip/mhshowsbr.c
0a970179a25b54325c4e5f49a4f85b2963920995
3 * mhshowsbr.c -- routines to display the contents of MIME messages
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.
12 #include <h/signals.h>
18 #include <h/mhparse.h>
22 #endif /* ! HAVE_ICONV */
32 /* flags for moreproc/header display */
38 static sigjmp_buf intrenv
;
42 int part_ok (CT
, int);
43 int type_ok (CT
, int);
44 void content_error (char *, CT
, char *, ...);
45 void flush_errors (void);
48 int list_switch (CT
, int, int, int, int);
49 int list_content (CT
, int, int, int, int);
54 void show_all_messages (CT
*);
55 int show_content_aux (CT
, int, int, char *, char *);
60 static void show_single_message (CT
, char *);
61 static void DisplayMsgHeader (CT
, char *);
62 static int show_switch (CT
, int, int);
63 static int show_content (CT
, int, int);
64 static int show_content_aux2 (CT
, int, int, char *, char *, int, int, int, int,
66 static int show_text (CT
, int, int);
67 static int show_multi (CT
, int, int);
68 static int show_multi_internal (CT
, int, int);
69 static int show_multi_aux (CT
, int, int, char *);
70 static int show_message_rfc822 (CT
, int, int);
71 static int show_partial (CT
, int, int);
72 static int show_external (CT
, int, int);
73 static int parse_display_string (CT
, char *, int *, int *, int *, int *, char *,
74 char *, size_t, int multipart
);
75 static int convert_content_charset (CT
, char **);
76 static void intrser (int);
80 * Top level entry point to show/display a group of messages
84 show_all_messages (CT
*cts
)
89 * If form is not specified, then get default form
90 * for showing headers of MIME messages.
93 formsw
= getcpy (etcpath ("mhl.headers"));
96 * If form is "mhl.null", suppress display of header.
98 if (!strcmp (formsw
, "mhl.null"))
101 for (ctp
= cts
; *ctp
; ctp
++) {
104 /* if top-level type is ok, then display message */
106 show_single_message (ct
, formsw
);
112 * Entry point to show/display a single message
116 show_single_message (CT ct
, char *form
)
122 /* Allow user executable bit so that temporary directories created by
123 * the viewer (e.g., lynx) are going to be accessible */
124 umask (ct
->c_umask
& ~(0100));
127 * If you have a format file, then display
128 * the message headers.
131 DisplayMsgHeader(ct
, form
);
135 /* Show the body of the message */
136 show_switch (ct
, 1, 0);
142 if (ct
->c_ceclosefnx
)
143 (*ct
->c_ceclosefnx
) (ct
);
145 /* block a few signals */
147 sigaddset (&set
, SIGHUP
);
148 sigaddset (&set
, SIGINT
);
149 sigaddset (&set
, SIGQUIT
);
150 sigaddset (&set
, SIGTERM
);
151 sigprocmask (SIG_BLOCK
, &set
, &oset
);
153 while (wait (&status
) != NOTOK
) {
158 /* reset the signal mask */
159 sigprocmask (SIG_SETMASK
, &oset
, &set
);
167 * Use the mhlproc to show the header fields
171 DisplayMsgHeader (CT ct
, char *form
)
178 vec
= argsplit(mhlproc
, &file
, &vecp
);
179 vec
[vecp
++] = getcpy("-form");
180 vec
[vecp
++] = getcpy(form
);
181 vec
[vecp
++] = getcpy("-nobody");
182 vec
[vecp
++] = getcpy(ct
->c_file
);
185 * If we've specified -(no)moreproc,
186 * then just pass that along.
189 vec
[vecp
++] = getcpy("-nomoreproc");
191 vec
[vecp
++] = getcpy("-moreproc");
192 vec
[vecp
++] = getcpy(progsw
);
198 for (i
= 0; (child_id
= fork()) == NOTOK
&& i
< 5; i
++)
203 adios ("fork", "unable to");
208 fprintf (stderr
, "unable to exec ");
218 arglist_free(file
, vec
);
223 * Switching routine. Call the correct routine
224 * based on content type.
228 show_switch (CT ct
, int serial
, int alternate
)
230 switch (ct
->c_type
) {
232 return show_multi (ct
, serial
, alternate
);
235 switch (ct
->c_subtype
) {
236 case MESSAGE_PARTIAL
:
237 return show_partial (ct
, serial
, alternate
);
239 case MESSAGE_EXTERNAL
:
240 return show_external (ct
, serial
, alternate
);
244 return show_message_rfc822 (ct
, serial
, alternate
);
248 return show_text (ct
, serial
, alternate
);
254 return show_content (ct
, serial
, alternate
);
257 adios (NULL
, "unknown content type %d", ct
->c_type
);
260 return 0; /* NOT REACHED */
265 * Generic method for displaying content
269 show_content (CT ct
, int serial
, int alternate
)
271 char *cp
, buffer
[BUFSIZ
];
272 CI ci
= &ct
->c_ctinfo
;
274 /* Check for invo_name-show-type/subtype */
275 snprintf (buffer
, sizeof(buffer
), "%s-show-%s/%s",
276 invo_name
, ci
->ci_type
, ci
->ci_subtype
);
277 if ((cp
= context_find (buffer
)) && *cp
!= '\0')
278 return show_content_aux (ct
, serial
, alternate
, cp
, NULL
);
280 /* Check for invo_name-show-type */
281 snprintf (buffer
, sizeof(buffer
), "%s-show-%s", invo_name
, ci
->ci_type
);
282 if ((cp
= context_find (buffer
)) && *cp
!= '\0')
283 return show_content_aux (ct
, serial
, alternate
, cp
, NULL
);
285 if ((cp
= ct
->c_showproc
))
286 return show_content_aux (ct
, serial
, alternate
, cp
, NULL
);
288 /* complain if we are not a part of a multipart/alternative */
290 content_error (NULL
, ct
, "don't know how to display content");
297 * Parse the display string for displaying generic content
301 show_content_aux (CT ct
, int serial
, int alternate
, char *cp
, char *cracked
)
304 int xstdin
= 0, xlist
= 0, xpause
= 0, xtty
= 0;
305 char *file
, buffer
[BUFSIZ
];
307 if (!ct
->c_ceopenfnx
) {
309 content_error (NULL
, ct
, "don't know how to decode content");
315 if ((fd
= (*ct
->c_ceopenfnx
) (ct
, &file
)) == NOTOK
)
317 if (ct
->c_showproc
&& !strcmp (ct
->c_showproc
, "true"))
318 return (alternate
? DONE
: OK
);
320 if (! strcmp(invo_name
, "mhshow") &&
321 ct
->c_type
== CT_TEXT
&& ct
->c_subtype
== TEXT_PLAIN
) {
322 /* This has to be done after calling c_ceopenfnx, so
323 unfortunately the type checks are necessary without
324 some code rearrangement. And to make this really ugly,
325 only do it in mhshow, not mhfixmsg, mhn, or mhstore. */
326 if (convert_content_charset (ct
, &file
) != OK
) {
327 admonish (NULL
, "unable to convert character set%s to %s",
328 ct
->c_partno
? "of part " : "",
329 ct
->c_partno
? ct
->c_partno
: "",
330 content_charset (ct
));
335 strncpy (buffer
, cp
, sizeof(buffer
));
339 if (parse_display_string (ct
, cp
, &xstdin
, &xlist
, &xpause
, &xtty
, file
,
340 buffer
, sizeof(buffer
) - 1, 0)) {
341 admonish (NULL
, "Buffer overflow constructing show command!\n");
346 return show_content_aux2 (ct
, serial
, alternate
, cracked
, buffer
,
347 fd
, xlist
, xpause
, xstdin
, xtty
);
352 * Routine to actually display the content
356 show_content_aux2 (CT ct
, int serial
, int alternate
, char *cracked
, char *buffer
,
357 int fd
, int xlist
, int xpause
, int xstdin
, int xtty
)
361 char *vec
[4], exec
[BUFSIZ
+ sizeof "exec "];
363 if (debugsw
|| cracked
) {
366 fprintf (stderr
, "%s msg %s", cracked
? "storing" : "show",
369 fprintf (stderr
, " part %s", ct
->c_partno
);
371 fprintf (stderr
, " using command (cd %s; %s)\n", cracked
, buffer
);
373 fprintf (stderr
, " using command %s\n", buffer
);
376 if (xpid
< 0 || (xtty
&& xpid
)) {
379 pidcheck(pidwait (xpid
, NOTOK
));
386 if (ct
->c_type
== CT_MULTIPART
)
387 list_content (ct
, -1, 1, 0, 0);
389 list_switch (ct
, -1, 1, 0, 0);
391 if (xpause
&& isatty (fileno (stdout
))) {
393 SIGNAL_HANDLER istat
;
395 if (SOprintf ("Press <return> to show content..."))
396 printf ("Press <return> to show content...");
398 istat
= SIGNAL (SIGINT
, intrser
);
399 if ((intr
= sigsetjmp (intrenv
, 1)) == OK
) {
402 read (fileno (stdout
), prompt
, sizeof(prompt
));
404 SIGNAL (SIGINT
, istat
);
405 if (intr
!= OK
|| prompt
[0] == 'n') {
406 (*ct
->c_ceclosefnx
) (ct
);
407 return (alternate
? DONE
: NOTOK
);
409 if (prompt
[0] == 'q') done(OK
);
413 snprintf (exec
, sizeof(exec
), "exec %s", buffer
);
422 for (i
= 0; (child_id
= fork()) == NOTOK
&& i
< 5; i
++)
426 advise ("fork", "unable to");
427 (*ct
->c_ceclosefnx
) (ct
);
436 execvp ("/bin/sh", vec
);
437 fprintf (stderr
, "unable to exec ");
444 ct
->c_pid
= child_id
;
448 pidcheck (pidXwait (child_id
, NULL
));
452 (*ct
->c_ceclosefnx
) (ct
);
453 return (alternate
? DONE
: OK
);
459 * show content of type "text"
463 show_text (CT ct
, int serial
, int alternate
)
465 char *cp
, buffer
[BUFSIZ
];
466 CI ci
= &ct
->c_ctinfo
;
468 /* Check for invo_name-show-type/subtype */
469 snprintf (buffer
, sizeof(buffer
), "%s-show-%s/%s",
470 invo_name
, ci
->ci_type
, ci
->ci_subtype
);
471 if ((cp
= context_find (buffer
)) && *cp
!= '\0')
472 return show_content_aux (ct
, serial
, alternate
, cp
, NULL
);
474 /* Check for invo_name-show-type */
475 snprintf (buffer
, sizeof(buffer
), "%s-show-%s", invo_name
, ci
->ci_type
);
476 if ((cp
= context_find (buffer
)) && *cp
!= '\0')
477 return show_content_aux (ct
, serial
, alternate
, cp
, NULL
);
480 * Use default method if content is text/plain, or if
481 * if it is not a text part of a multipart/alternative
483 if (!alternate
|| ct
->c_subtype
== TEXT_PLAIN
) {
484 snprintf (buffer
, sizeof(buffer
), "%%p%s '%%F'", progsw
? progsw
:
485 moreproc
&& *moreproc
? moreproc
: DEFAULT_PAGER
);
486 cp
= (ct
->c_showproc
= add (buffer
, NULL
));
487 return show_content_aux (ct
, serial
, alternate
, cp
, NULL
);
495 * show message body of type "multipart"
499 show_multi (CT ct
, int serial
, int alternate
)
501 char *cp
, buffer
[BUFSIZ
];
502 CI ci
= &ct
->c_ctinfo
;
504 /* Check for invo_name-show-type/subtype */
505 snprintf (buffer
, sizeof(buffer
), "%s-show-%s/%s",
506 invo_name
, ci
->ci_type
, ci
->ci_subtype
);
507 if ((cp
= context_find (buffer
)) && *cp
!= '\0')
508 return show_multi_aux (ct
, serial
, alternate
, cp
);
510 /* Check for invo_name-show-type */
511 snprintf (buffer
, sizeof(buffer
), "%s-show-%s", invo_name
, ci
->ci_type
);
512 if ((cp
= context_find (buffer
)) && *cp
!= '\0')
513 return show_multi_aux (ct
, serial
, alternate
, cp
);
515 if ((cp
= ct
->c_showproc
))
516 return show_multi_aux (ct
, serial
, alternate
, cp
);
519 * Use default method to display this multipart content. Even
520 * unknown types are displayable, since they're treated as mixed
523 return show_multi_internal (ct
, serial
, alternate
);
528 * show message body of subtypes of multipart that
529 * we understand directly (mixed, alternate, etc...)
533 show_multi_internal (CT ct
, int serial
, int alternate
)
535 int alternating
, nowalternate
, nowserial
, result
;
536 struct multipart
*m
= (struct multipart
*) ct
->c_ctparams
;
542 nowalternate
= alternate
;
544 if (ct
->c_subtype
== MULTI_PARALLEL
) {
545 nowserial
= serialsw
;
546 } else if (ct
->c_subtype
== MULTI_ALTERNATE
) {
554 * unknown subtypes of multipart (treat as mixed per rfc2046)
559 /* block a few signals */
562 sigaddset (&set
, SIGHUP
);
563 sigaddset (&set
, SIGINT
);
564 sigaddset (&set
, SIGQUIT
);
565 sigaddset (&set
, SIGTERM
);
566 sigprocmask (SIG_BLOCK
, &set
, &oset
);
570 * alternate -> we are a part inside an multipart/alternative
571 * alternating -> we are a multipart/alternative
574 result
= alternate
? NOTOK
: OK
;
576 for (part
= m
->mp_parts
; part
; part
= part
->mp_next
) {
579 if (part_ok (p
, 1) && type_ok (p
, 1)) {
582 inneresult
= show_switch (p
, nowserial
, nowalternate
);
583 switch (inneresult
) {
585 if (alternate
&& !alternating
) {
598 alternate
= nowalternate
= 0;
608 if (alternating
&& !part
) {
610 content_error (NULL
, ct
, "don't know how to display any of the contents");
615 if (serial
&& !nowserial
) {
621 for (part
= m
->mp_parts
; part
; part
= part
->mp_next
) {
625 if (kill (p
->c_pid
, 0) == NOTOK
)
632 while (kids
> 0 && (pid
= wait (&status
)) != NOTOK
) {
635 for (part
= m
->mp_parts
; part
; part
= part
->mp_next
) {
640 if (p
->c_pid
== pid
) {
651 /* reset the signal mask */
652 sigprocmask (SIG_SETMASK
, &oset
, &set
);
660 * Parse display string for multipart content
661 * and use external program to display it.
665 show_multi_aux (CT ct
, int serial
, int alternate
, char *cp
)
667 /* xstdin is only used in the call to parse_display_string():
668 its value is ignored in the function. */
669 int xstdin
= 0, xlist
= 0, xpause
= 0, xtty
= 0;
670 char *file
, buffer
[BUFSIZ
];
671 struct multipart
*m
= (struct multipart
*) ct
->c_ctparams
;
675 for (part
= m
->mp_parts
; part
; part
= part
->mp_next
) {
678 if (!p
->c_ceopenfnx
) {
680 content_error (NULL
, p
, "don't know how to decode content");
684 if (p
->c_storage
== NULL
) {
686 if ((*p
->c_ceopenfnx
) (p
, &file
) == NOTOK
)
689 /* I'm not sure if this is necessary? */
690 p
->c_storage
= add (file
, NULL
);
692 if (p
->c_showproc
&& !strcmp (p
->c_showproc
, "true"))
693 return (alternate
? DONE
: OK
);
694 (*p
->c_ceclosefnx
) (p
);
698 if (parse_display_string (ct
, cp
, &xstdin
, &xlist
, &xpause
, &xtty
, file
,
699 buffer
, sizeof(buffer
) - 1, 1)) {
700 admonish (NULL
, "Buffer overflow constructing show command!\n");
704 return show_content_aux2 (ct
, serial
, alternate
, NULL
, buffer
,
705 NOTOK
, xlist
, xpause
, 0, xtty
);
710 * show content of type "message/rfc822"
714 show_message_rfc822 (CT ct
, int serial
, int alternate
)
716 char *cp
, buffer
[BUFSIZ
];
717 CI ci
= &ct
->c_ctinfo
;
719 /* Check for invo_name-show-type/subtype */
720 snprintf (buffer
, sizeof(buffer
), "%s-show-%s/%s",
721 invo_name
, ci
->ci_type
, ci
->ci_subtype
);
722 if ((cp
= context_find (buffer
)) && *cp
!= '\0')
723 return show_content_aux (ct
, serial
, alternate
, cp
, NULL
);
725 /* Check for invo_name-show-type */
726 snprintf (buffer
, sizeof(buffer
), "%s-show-%s", invo_name
, ci
->ci_type
);
727 if ((cp
= context_find (buffer
)) && *cp
!= '\0')
728 return show_content_aux (ct
, serial
, alternate
, cp
, NULL
);
730 if ((cp
= ct
->c_showproc
))
731 return show_content_aux (ct
, serial
, alternate
, cp
, NULL
);
733 /* default method for message/rfc822 */
734 if (ct
->c_subtype
== MESSAGE_RFC822
) {
735 cp
= (ct
->c_showproc
= add ("%pshow -file '%F'", NULL
));
736 return show_content_aux (ct
, serial
, alternate
, cp
, NULL
);
739 /* complain if we are not a part of a multipart/alternative */
741 content_error (NULL
, ct
, "don't know how to display content");
748 * Show content of type "message/partial".
752 show_partial (CT ct
, int serial
, int alternate
)
755 NMH_UNUSED (alternate
);
757 content_error (NULL
, ct
,
758 "in order to display this message, you must reassemble it");
764 * Show content of type "message/external".
766 * THE ERROR CHECKING IN THIS ONE IS NOT DONE YET.
770 show_external (CT ct
, int serial
, int alternate
)
772 struct exbody
*e
= (struct exbody
*) ct
->c_ctparams
;
773 CT p
= e
->eb_content
;
778 return show_switch (p
, serial
, alternate
);
783 parse_display_string (CT ct
, char *cp
, int *xstdin
, int *xlist
, int *xpause
,
784 int *xtty
, char *file
, char *buffer
, size_t buflen
,
787 char *bp
= buffer
, *pp
;
788 CI ci
= &ct
->c_ctinfo
;
790 bp
[0] = bp
[buflen
] = '\0';
792 for ( ; *cp
&& buflen
> 0; cp
++) {
798 /* insert parameters from Content-Type field */
803 for (ap
= ci
->ci_attrs
, ep
= ci
->ci_values
; *ap
; ap
++, ep
++) {
804 snprintf (bp
, buflen
, "%s%s=\"%s\"", s
, *ap
, *ep
);
814 /* insert content description */
818 s
= trimcpy (ct
->c_descr
);
819 strncpy (bp
, s
, buflen
);
825 /* exclusive execution */
830 /* %e, %f, and stdin is terminal not content */
837 /* insert filename(s) containing content */
838 struct multipart
*m
= (struct multipart
*) ct
->c_ctparams
;
843 for (part
= m
->mp_parts
; part
; part
= part
->mp_next
) {
846 snprintf (bp
, buflen
, "%s'%s'", s
, p
->c_storage
);
852 /* set our starting pointer back to bp, to avoid
853 * requoting the filenames we just added
857 /* insert filename containing content */
858 snprintf (bp
, buflen
, "'%s'", file
);
859 /* since we've quoted the file argument, set things up
860 * to look past it, to avoid problems with the quoting
861 * logic below. (I know, I should figure out what's
862 * broken with the quoting logic, but..)
872 /* %l, and pause prior to displaying content */
877 /* display listing prior to displaying content */
882 /* insert subtype of content */
883 strncpy (bp
, ci
->ci_subtype
, buflen
);
887 /* insert character % */
900 /* Did we actually insert something? */
902 /* Insert single quote if not inside quotes already */
903 if (!quoted
&& buflen
) {
905 memmove (pp
+ 1, pp
, len
);
910 /* Escape existing quotes */
911 while ((pp
= strchr (pp
, '\'')) && buflen
> 3) {
913 memmove (pp
+ 3, pp
, len
);
920 /* If pp is still set, that means we ran out of space. */
923 if (!quoted
&& buflen
) {
941 (ct
->c_termproc
&& buflen
<= strlen(ct
->c_termproc
))) {
942 /* content_error would provide a more useful error message
943 * here, except that if we got overrun, it probably would
949 /* use charset string to modify display method */
950 if (ct
->c_termproc
) {
953 strncpy (term
, buffer
, sizeof(term
));
954 snprintf (buffer
, buflen
, ct
->c_termproc
, term
);
962 convert_charset (CT ct
, char *dest_charset
, int *message_mods
) {
963 char *src_charset
= content_charset (ct
);
966 /* norm_charmap() is case sensitive. */
967 char *src_charset_u
= upcase (src_charset
);
968 char *dest_charset_u
= upcase (dest_charset
);
969 int different_charsets
=
970 strcmp (norm_charmap (src_charset
), norm_charmap (dest_charset
));
972 free (dest_charset_u
);
973 free (src_charset_u
);
975 if (different_charsets
) {
977 iconv_t conv_desc
= NULL
;
984 int opened_input_file
= 0;
985 char src_buffer
[BUFSIZ
];
989 if ((conv_desc
= iconv_open (dest_charset
, src_charset
)) ==
991 advise (NULL
, "Can't convert %s to %s", src_charset
, dest_charset
);
995 if ((tempfile
= m_mktemp2 (NULL
, invo_name
, &fd
, NULL
)) == NULL
) {
996 adios (NULL
, "unable to create temporary file in %s",
999 dest
= add (tempfile
, NULL
);
1001 if (ct
->c_cefile
.ce_file
) {
1002 file
= &ct
->c_cefile
.ce_file
;
1003 fp
= &ct
->c_cefile
.ce_fp
;
1005 } else if (ct
->c_file
) {
1008 begin
= (size_t) ct
->c_begin
;
1009 end
= (size_t) ct
->c_end
;
1010 } /* else no input file: shouldn't happen */
1012 if (file
&& *file
&& fp
) {
1014 if ((*fp
= fopen (*file
, "r")) == NULL
) {
1015 advise (*file
, "unable to open for reading");
1018 opened_input_file
= 1;
1025 size_t bytes_to_read
=
1026 end
> 0 && end
> begin
? end
- begin
: sizeof src_buffer
;
1028 fseeko (*fp
, begin
, SEEK_SET
);
1029 while ((inbytes
= fread (src_buffer
, 1,
1030 min (bytes_to_read
, sizeof src_buffer
),
1032 char dest_buffer
[BUFSIZ
];
1033 ICONV_CONST
char *ib
= src_buffer
;
1034 char *ob
= dest_buffer
;
1035 size_t outbytes
= sizeof dest_buffer
;
1036 size_t outbytes_before
= outbytes
;
1038 if (end
> 0) bytes_to_read
-= inbytes
;
1040 if (iconv (conv_desc
, &ib
, &inbytes
, &ob
, &outbytes
) ==
1045 write (fd
, dest_buffer
, outbytes_before
- outbytes
);
1049 if (opened_input_file
) {
1055 iconv_close (conv_desc
);
1059 /* Replace the decoded file with the converted one. */
1060 if (ct
->c_cefile
.ce_file
) {
1061 if (ct
->c_cefile
.ce_unlink
) {
1062 (void) m_unlink (ct
->c_cefile
.ce_file
);
1064 free (ct
->c_cefile
.ce_file
);
1066 ct
->c_cefile
.ce_file
= dest
;
1067 ct
->c_cefile
.ce_unlink
= 1;
1071 /* Update ci_attrs. */
1072 src_charset
= dest_charset
;
1074 /* Update ct->c_ctline. */
1077 update_attr (ct
->c_ctline
, "charset=", dest_charset
);
1079 free (ct
->c_ctline
);
1080 ct
->c_ctline
= ctline
;
1081 } /* else no CT line, which is odd */
1083 /* Update Content-Type header field. */
1084 for (hf
= ct
->c_first_hf
; hf
; hf
= hf
->next
) {
1085 if (! strcasecmp (TYPE_FIELD
, hf
->name
)) {
1086 char *ctline_less_newline
=
1087 update_attr (hf
->value
, "charset=", dest_charset
);
1088 char *ctline
= concat (ctline_less_newline
, "\n", NULL
);
1089 free (ctline_less_newline
);
1097 (void) m_unlink (dest
);
1099 #else /* ! HAVE_ICONV */
1100 NMH_UNUSED (message_mods
);
1102 advise (NULL
, "Can't convert %s to %s without iconv", src_charset
,
1105 #endif /* ! HAVE_ICONV */
1113 convert_content_charset (CT ct
, char **file
) {
1115 /* Using current locale, see if the content needs to be converted. */
1117 /* content_charset() cannot return NULL. */
1118 char *charset
= content_charset (ct
);
1120 if (! check_charset (charset
, strlen (charset
))) {
1123 if (convert_charset (ct
, get_charset (), &unused
) == 0) {
1124 *file
= ct
->c_cefile
.ce_file
;
1129 #endif /* ! HAVE_ICONV */
1141 siglongjmp (intrenv
, DONE
);