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>");

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?

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
--
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