> Actually, I just realized .... check_charset() and > write_charset_8bit() both save the pointer returned from > get_charset() (which calls norm_charmap()). Those interfaces are > broken as designed. Seems like the right solution there would be to > have get_charset() copy the return value from norm_charmap() into > it's own buffer? That could be statically allocated, since it > shouldn't change between calls.
That would help. But I think that the whole business should be reviewed and possibly redesigned. As in, provide an sbr function to say whether or not two charset names match. Callers that just need that would no longer have to be concerned with memory management. Another inconvenience is that norm_charmap() is case-sensitive (except for a few (why not all?) forms of "Big5"). And I think the norm_charmap() code should be simplified to just look for the ASCII and 8859 varities, and pass anything else back. That's what it does now, in effect, except for "TIS620.2533" and the few forms of "Big5". David _______________________________________________ Nmh-workers mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/nmh-workers
