zsh-workers
 help / color / mirror / code / Atom feed
* Handling of LANG (and other LC_*) in zsh.
@ 1996-07-08 14:35 Andrej Borsenkow
  0 siblings, 0 replies; only message in thread
From: Andrej Borsenkow @ 1996-07-08 14:35 UTC (permalink / raw)
  To: Zsh workers mailing list

Hi!

I already mentioned this problem; now I try to provide patch for it ;-)

Environment: zsh-3.0-pre2
Problem: if LANG is changed, zsh tries to change its locale by using
setlocale(LC_ALL, <value of LANG>). Alas! it breaks normal handling of
locale: if any of LC_* is set, it overrides LANG setting.

I tried to solve it in some portable (IMHO;) way: when any of LANG or LC_*
variables is changed, it is put in zsh environment and
setlocale(LC_ALL,"") is called; it should have the same effect as setting
variable in environment *before* starting zsh.

I put all LC_* there; it doesn't hurt even if on some systems they are not
used, does it?

I am not member of this list; so I would appreciate any Cc of you comments
on my suggestion. 

Diffs attached

greetings

-------------------------------------------------------------------------
Andrej Borsenkow 		Fax:   +7 (095) 252 01 05
SNI ITS Moscow			Tel:   +7 (095) 252 13 88

NERV:  borsenkow.msk		E-Mail: borsenkow.msk@sni.de
-------------------------------------------------------------------------

======================= diffs ============================
--- Src/hashtable.h.org	Mon Jul  8 17:37:55 1996
+++ Src/hashtable.h	Mon Jul  8 17:37:25 1996
@@ -106,6 +106,13 @@
 IPDEF2("_", underscoregetfn, IFN(nullsetfn), PM_READONLY),
 #ifdef LC_ALL
 IPDEF2("LANG", strgetfn, langsetfn, 0),
+IPDEF2("LC_CTYPE", strgetfn, langsetfn, 0),
+IPDEF2("LC_NUMERIC", strgetfn, langsetfn, 0),
+IPDEF2("LC_TIME", strgetfn, langsetfn, 0),
+IPDEF2("LC_COLLATE", strgetfn, langsetfn, 0),
+IPDEF2("LC_MONETARY", strgetfn, langsetfn, 0),
+IPDEF2("LC_MESSAGES", strgetfn, langsetfn, 0),
+IPDEF2("LC_ALL", strgetfn, langsetfn, 0),
 #endif
 
 #define IPDEF4(A,B) {NULL,A,PM_INTEGER|PM_READONLY|PM_SPECIAL,NULL,IFN(nullsetfn),IFN(intvargetfn),10,(void *)B,NULL,NULL,NULL,0}
--- Src/params.c.org	Mon Jul  8 17:38:03 1996
+++ Src/params.c	Mon Jul  8 17:40:32 1996
@@ -1567,7 +1567,8 @@
 void
 langsetfn(Param pm, char *x)
 {
-   setlocale(LC_ALL, x);
+   addenv(pm->nam, x);
+   setlocale(LC_ALL, "");
    strsetfn(pm, x);
 }
 #endif



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-07-08 14:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-07-08 14:35 Handling of LANG (and other LC_*) in zsh Andrej Borsenkow

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).