* parameter bugfix
@ 1997-04-26 19:49 Zefram
0 siblings, 0 replies; only message in thread
From: Zefram @ 1997-04-26 19:49 UTC (permalink / raw)
To: zsh-workers
-----BEGIN PGP SIGNED MESSAGE-----
One of my earlier patches, 3014 I think, merging a couple of elements
of the param structure, breaks the LC_* parameters, which rely on those
two elements being distinct. This patch fixes it; as only lcsetfn() is
affected, and the necessary table already exists, it modifies lcsetfn()
to not require the data member.
-zefram
*** Src/hashtable.h 1997/03/31 18:09:29 1.32
--- Src/hashtable.h 1997/04/26 15:32:33
***************
*** 114,133 ****
IPDEF2("_", underscoregetfn, nullsetfn, PM_READONLY),
#ifdef LC_ALL
! #define LCIPDEF(A,B) {NULL,A,PM_SCALAR|PM_SPECIAL|PM_UNSET,BR((void *)B),SFN(lcsetfn),GFN(strgetfn),stdunsetfn,0,NULL,NULL,NULL,0}
IPDEF2("LANG", strgetfn, langsetfn, PM_UNSET),
IPDEF2("LC_ALL", strgetfn, lc_allsetfn, PM_UNSET),
#ifdef LC_COLLATE
! LCIPDEF("LC_COLLATE", LC_COLLATE),
#endif
#ifdef LC_CTYPE
! LCIPDEF("LC_CTYPE", LC_CTYPE),
#endif
#ifdef LC_MESSAGES
! LCIPDEF("LC_MESSAGES", LC_MESSAGES),
#endif
#ifdef LC_TIME
! LCIPDEF("LC_TIME", LC_TIME),
#endif
#endif
--- 114,133 ----
IPDEF2("_", underscoregetfn, nullsetfn, PM_READONLY),
#ifdef LC_ALL
! #define LCIPDEF(name) IPDEF2(name, strgetfn, lcsetfn, PM_UNSET)
IPDEF2("LANG", strgetfn, langsetfn, PM_UNSET),
IPDEF2("LC_ALL", strgetfn, lc_allsetfn, PM_UNSET),
#ifdef LC_COLLATE
! LCIPDEF("LC_COLLATE"),
#endif
#ifdef LC_CTYPE
! LCIPDEF("LC_CTYPE"),
#endif
#ifdef LC_MESSAGES
! LCIPDEF("LC_MESSAGES"),
#endif
#ifdef LC_TIME
! LCIPDEF("LC_TIME"),
#endif
#endif
*** Src/params.c 1997/04/01 08:59:53 1.45
--- Src/params.c 1997/04/26 15:30:09
***************
*** 1615,1626 ****
void
lcsetfn(Param pm, char *x)
{
strsetfn(pm, x);
if (getsparam("LC_ALL"))
return;
if (!x)
x = getsparam("LANG");
! setlocale((int) pm->u.data, x ? x : "");
}
#endif
--- 1615,1631 ----
void
lcsetfn(Param pm, char *x)
{
+ struct localename *ln;
+
strsetfn(pm, x);
if (getsparam("LC_ALL"))
return;
if (!x)
x = getsparam("LANG");
!
! for (ln = lc_names; ln->name; ln++)
! if (!strcmp(ln->name, pm->nam))
! setlocale(ln->category, x ? x : "");
}
#endif
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: ascii
iQCVAwUBM2IiTHD/+HJTpU/hAQGexAP+NZpG+21ARK142RgsiJnTSQqbpaxryB54
xxcaPXAgk9+2HtyMNAs30P5gUqOHkQVxjuPZY6KL01TbsW0u7gjpOZ49uhyw1dpY
+BkAH974h0ncKofEDNuTXMM0Qcp9wOvPht3oiQbkd5PMgvQVnjhKzqvxILr+l+LC
Pc9EWqwcnLc=
=4qOL
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1997-04-26 19:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-04-26 19:49 parameter bugfix Zefram
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).