FVWM Bug Tracking notification

new message incoming/892

Message summary for PR#892
        From: [EMAIL PROTECTED]
        Subject: FvwmForm: getenv LC_CTYPE
        Date: Mon, 03 Jun 2002 06:31:58 -0500
        0 replies       0 followups

====> ORIGINAL MESSAGE FOLLOWS <====

>From [EMAIL PROTECTED] Mon Jun 03 06:31:59 2002
Received: from util2.math.uh.edu ([129.7.128.23])
        by malifon.math.uh.edu with esmtp (Exim 3.20 #1)
        id 17Eq47-0005Mx-00
        for [EMAIL PROTECTED]; Mon, 03 Jun 2002 06:31:59 -0500
Received: from malifon.math.uh.edu ([129.7.128.13] ident=mail)
        by util2.math.uh.edu with esmtp (Exim 4.04)
        id 17Eq47-0007eS-00
        for [EMAIL PROTECTED]; Mon, 03 Jun 2002 06:31:59 -0500
Received: from localhost ([127.0.0.1] ident=65534)
        by malifon.math.uh.edu with esmtp (Exim 3.20 #1)
        id 17Eq46-0005Mt-00
        for [EMAIL PROTECTED]; Mon, 03 Jun 2002 06:31:58 -0500
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.

Here is 1 line patch:
----- cut here -----
diff -aurN fvwm-snap-20020602.orig/modules/FvwmForm/FvwmForm.c
fvwm-snap-20020602/modules/FvwmForm/FvwmForm.c
--- fvwm-snap-20020602.orig/modules/FvwmForm/FvwmForm.c 2002-06-03
20:02:25.000000000 +0900
+++ fvwm-snap-20020602/modules/FvwmForm/FvwmForm.c      2002-06-03
20:03:28.000000000 +0900
@@ -2398,7 +2398,7 @@
   freopen(".FvwmFormDebug","w",stderr);
 #endif
 
-  FlocaleInit(LC_CTYPE, getenv("LC_CTYPE"), "", "FvwmForm");
+  FlocaleInit(LC_CTYPE, "", "", "FvwmForm");
 
   /* From FvwmAnimate start */
   /* Save our program  name - for error events */
----- cut here -----




--
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