On Mon, Jun 03, 2002 at 06:23:10PM +0200, Dominik Vogt wrote:
> On Mon, Jun 03, 2002 at 04:32:34PM +0200, Olivier Chapuis wrote:
> > On Mon, Jun 03, 2002 at 06:31:59AM -0500, [EMAIL PROTECTED] wrote:
> > > FVWM Bug Tracking notification
> > > From: [EMAIL PROTECTED]
> > > To: [EMAIL PROTECTED]
> > > Subject: FvwmForm: getenv LC_CTYPE
> > > Message-Id: <[EMAIL PROTECTED]>
> > > Date: Mon, 03 Jun 2002 06:31:58 -0500
> > > 
> > > Full_Name: YAMAGUCHI Shingo
> > > Version: snapshot 20020531, snapshot 20020602
> > > CVS_Date: 
> > > OS: Linux 2.4.18 (glibc 2.2.5, gcc 3.1)
> > > X_Server: XFree86 4.2.99.1
> > > Submission from: (NULL) (210.128.199.160)
> > > 
> > > 
> > > If LC_CTYPE is undefined, FvwmForm cannot display any multibyte (I use
> > > EUC-JP) character (If LC_CTYPE set to "ja_JP.eucJP", FvwmForm works fine).
> > > 
> > > FlocaleInit() in FvwmForm main() is this:
> > > 
> > >   FlocaleInit(LC_CTYPE, getenv("LC_CTYPE"), "", "FvwmForm");
> > > 
> > > If "LC_CTYPE" environment variable is undefined, getenv() returns NULL
> > > pointer. And NULL pointer is sent to setlocale() in FlocaleInit(). If
> > > setlocale() receive NULL pointer locale argument, return value is
> > > undefined.
> > > 
> > > Instead of using getenv(), use "empty string". i.e.:
> > > 
> > >   FlocaleInit(LC_CTYPE, "", "", "FvwmForm");
> > > 
> > > This means "Use default locale which is selected from one of the
> > > environment variables (LC_*, LANG)". This technique is used on FvwmPager
> > > etc.
> > >
> > 
> > Yes, I've applied the patch. FlocaleInit was called in the
> > good way every where but in FvwmForm. A "miss print" :o)
> 
> Hm, if the arguments of FlocaleInit() are always the same, then
> why not put the code handling LC_CTYPE etc. directly into that
> function?  As far as I can see, it's always called like this:
> 
>   FlocaleInit(LC_CTYPE, "", "", "<module name>");
>

Yes.
 
> The only parameter that ever changes is the last one.  So, why
> not simply strip the first three arguments and hard code them
> inside the function?
>

I've no objection. But when I rewrite the locale stuff
I thought that having this parameters may be good under
certain situation (e.g., switching between locale
or enforcing one for special reason). Now maybe we
will never use this 2 parameters in the future, but
it does not seem to me that this is a big problem.

Olivier
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]

Reply via email to