Hi, Fabrizio.

At Tue, 14 Sep 1999 08:05:03 +0300,
Fabrizio Polacco <[EMAIL PROTECTED]> wrote:

> [crossposted to debian-i18n because I need people from other charsets to
> compelte the table in the patch and try if and how it works for their
> languages/charsets.]
> 
> Here is an attempt to have man-db display pages written in languages
> other than latin1 to show correctly using their own charset.
> Apply the patch to man-db -69i sources and recompile.
> You don't need to make a new package, or to change your machine: issue
> debian/rules debug (need sudo installed) and you'll get the new binary
> as src/man with the correct permissions.
> If you want to debug it, use   sudo gdb src/man    to get it working, as
> gdb croacks on setgid binaries.

Hmm, As I checked your patch, it does not work correctly.  
The following for() loop never run, because at first j = 0, then
j && lang_table[j].lang will be false. so it would never check lang_table.

> +                             int j;
> +                             for ( j=0; j && lang_table[j].lang; j++ ) {
> +                                     if (( strncmp( lang_table[j].lang, lang
> +                                             , strlen( lang_table[j].lang)) 
> == 0 )
> +                                     ||  ( lang_table[j].lang[0] == '*' )) {
> +                                             roff_device = 
> lang_table[j].device;
> +                                             troff = 1;
> +                                             putenv( strappend ( 0
> +                                                     ,"LESSCHARSET="
> +                                                     , lang_table[j].charset
> +                                                     , 0));
> +                                     }
> +                                     j= -1;
> +                             }

I'm not sure what you intend here exactly, but I think it should be
the followings, shouldn't it?

                                int j;
                                for ( j=0; lang_table[j].lang; j++ ) {
                                        if (( strncmp( lang_table[j].lang, lang
                                                , strlen( lang_table[j].lang)) 
== 0 )
                                        ||  ( lang_table[j].lang[0] == '*' )) {
                                                roff_device = 
lang_table[j].device;
                                                troff = 1;
                                                putenv( strappend ( 0
                                                        ,"LESSCHARSET="
                                                        , lang_table[j].charset
                                                        , 0));
                                                break;
                                        }
                                }

With this fix, it works fine for LANG=ja. Thanks!

Regards,
Fumitoshi UKAI

Reply via email to