Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

parameter bugfix



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



Messages sorted by: Reverse Date, Date, Thread, Author