<<< Date Index >>>     <<< Thread Index >>>

Re: iconv-hook patch (Re: 1.5.12 this Thursday.)



Hello Tamotsu,

 On Wednesday, July 12, 2006 at 22:44:20 +0900, Tamotsu Takahashi wrote:

> it is good to apply MORIYAMA-san's iconv-hook patch [...] well-tested
> for years by many users. Yes, it is a bug fix, IMO.

    Some words more, if you permit: In Mutt 1.5.12 and CVS, iconv-hooks
suffer from 4 bugs (2 grave and 2 minor):

 -1) At iconv-hook stage, mutt_iconv_open() fails -1, unless *both*
fromcode and tocode are matched by an iconv-hook. This prohibits to work
with one valid already known charset, and the other needing iconv-hook.

 -2) When parsing iconv-hooks, mutt_parse_hook() erroneously expands the
regexp by $default_hook. Example with:

| iconv-hook ^iso-8859-1$ ISO88591

    The regexp get expanded to:

| ~f "^iso-8859-1$" !~P | (~P ~C "^iso-8859-1$")

    Wich makes no sense to regexec(), later at matching time.

 -3) When checking regexp syntax, mutt_parse_hook() doesn't use the
REG_ICASE mode intended for iconv-hooks.

 -4) In mbyte.c there is the one last forgotten occurence of direct call
to the system iconv_open() function, instead of mutt_iconv_open(). This
inhibits iconv-hooks there.

    The original Masayuki Moriyama's patch has 4 hunks. Each hunk fixes
one of these bugs, in order, and in what seems to me the simple obvious
way. I added some comments inside the attached patch, where code is
identical. Big thanks to the author. Please apply.


    BTW while working on that, I corrected some minor lacks or
inaccuracies in the manual, about $default_hook, pattern vs regexp,
reply/send2-hook, and such. Patch attached also.


Bye!    Alain.
-- 
Give your computer's unused idle processor cycles to a scientific goal:
The Folding@home project at <URL:http://folding.stanford.edu/>.

Attachment: patch-1.5.12.msyk.iconvhook.1-ab.gz
Description: application/gunzip

Attachment: patch-1.5.12.ab.doc_lacking_hooks.1.gz
Description: application/gunzip