1 /* $Header: /p/tcsh/cvsroot/tcsh/sh.set.c,v 3.72 2007/09/28 21:02:03 christos Exp $ */
3 * sh.set.c: Setting and Clearing of variables
6 * Copyright (c) 1980, 1991 The Regents of the University of California.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 RCSID("$tcsh: sh.set.c,v 3.72 2007/09/28 21:02:03 christos Exp $")
40 #ifdef HAVE_NL_LANGINFO
44 extern int GotTermCaps;
47 static void update_vars (Char *);
48 static Char *getinx (Char *, int *);
49 static void asx (Char *, int, Char *);
50 static struct varent *getvx (Char *, int);
51 static Char *xset (Char *, Char ***);
52 static Char *operate (int, Char *, Char *);
53 static void putn1 (unsigned);
54 static struct varent *madrof (Char *, struct varent *);
55 static void unsetv1 (struct varent *);
56 static void exportpath (Char **);
57 static void balance (struct varent *, int, int);
66 if (eq(vp, STRpath)) {
67 struct varent *p = adrof(STRpath);
69 stderror(ERR_NAME | ERR_UNDVAR);
75 else if (eq(vp, STRhistchars)) {
76 Char *pn = varval(vp);
81 else if (eq(vp, STRpromptchars)) {
82 Char *pn = varval(vp);
87 else if (eq(vp, STRhistlit)) {
90 else if (eq(vp, STRuser)) {
91 tsetenv(STRKUSER, varval(vp));
92 tsetenv(STRLOGNAME, varval(vp));
94 else if (eq(vp, STRgroup)) {
95 tsetenv(STRKGROUP, varval(vp));
97 else if (eq(vp, STRwordchars)) {
98 word_chars = varval(vp);
100 else if (eq(vp, STRloginsh)) {
103 else if (eq(vp, STRsymlinks)) {
104 Char *pn = varval(vp);
106 if (eq(pn, STRignore))
107 symlinks = SYM_IGNORE;
108 else if (eq(pn, STRexpand))
109 symlinks = SYM_EXPAND;
110 else if (eq(pn, STRchase))
111 symlinks = SYM_CHASE;
115 else if (eq(vp, STRterm)) {
116 Char *cp = varval(vp);
117 tsetenv(STRKTERM, cp);
118 #ifdef DOESNT_WORK_RIGHT
119 cp = getenv("TERMCAP");
120 if (cp && (*cp != '/')) /* if TERMCAP and not a path */
121 Unsetenv(STRTERMCAP);
122 #endif /* DOESNT_WORK_RIGHT */
124 if (noediting && Strcmp(cp, STRnetwork) != 0 &&
125 Strcmp(cp, STRunknown) != 0 && Strcmp(cp, STRdumb) != 0) {
130 ed_Init(); /* reset the editor */
132 else if (eq(vp, STRhome)) {
135 cp = Strsave(varval(vp)); /* get the old value back */
136 cleanup_push(cp, xfree);
139 * convert to cononical pathname (possibly resolving symlinks)
141 canon = dcanon(cp, cp);
144 cleanup_push(canon, xfree);
146 setcopy(vp, canon, VAR_READWRITE); /* have to save the new val */
148 /* and now mirror home with HOME */
149 tsetenv(STRKHOME, canon);
150 /* fix directory stack for new tilde home */
152 cleanup_until(canon);
154 else if (eq(vp, STRedit)) {
157 /* PWP: add more stuff in here later */
159 else if (eq(vp, STRshlvl)) {
160 tsetenv(STRKSHLVL, varval(vp));
162 else if (eq(vp, STRignoreeof)) {
165 for ((cp = varval(STRignoreeof)); cp && *cp; cp++) {
170 numeof = numeof * 10 + *cp - '0';
172 if (numeof <= 0) numeof = 26; /* Sanity check */
174 else if (eq(vp, STRbackslash_quote)) {
177 else if (eq(vp, STRcompat_expr)) {
180 else if (eq(vp, STRdirstack)) {
183 else if (eq(vp, STRrecognize_only_executables)) {
186 else if (eq(vp, STRkillring)) {
187 SetKillRing(getn(varval(vp)));
190 else if (eq(vp, STRwatch)) {
193 #endif /* HAVENOUTMP */
194 else if (eq(vp, STRimplicitcd)) {
195 implicit_cd = ((eq(varval(vp), STRverbose)) ? 2 : 1);
198 else if (eq(vp, STRcolor)) {
201 #endif /* COLOR_LS_F */
202 #if defined(KANJI) && defined(SHORT_STRINGS) && defined(DSPMBYTE)
203 else if(eq(vp, CHECK_MBYTEVAR) || eq(vp, STRnokanji)) {
204 update_dspmbyte_vars();
208 else if (eq(vp, STRcatalog)) {
212 #if defined(FILEC) && defined(TIOCSTI)
213 else if (eq(vp, STRfilec))
216 #endif /* NLS_CATALOGS */
222 doset(Char **v, struct command *c)
229 int flags = VAR_READWRITE;
239 * Readonly addition From: Tim P. Starrin <noid@cyborg.larc.nasa.gov>
241 if (*v && eq(*v, STRmr)) {
242 flags = VAR_READONLY;
246 if (*v && eq(*v, STRmf) && !last_match) {
251 if (*v && eq(*v, STRml) && !first_match) {
259 plist(&shvhed, flags);
266 for (; alnum(*p); p++)
268 if (vp == p || !letter(*vp))
269 stderror(ERR_NAME | ERR_VARBEGIN);
272 p = getinx(p, &subscr);
274 if ((op = *p) != 0) {
276 if (*p == 0 && *v && **v == '(')
279 else if (*v && eq(*v, STRequal)) {
285 stderror(ERR_NAME | ERR_SYNTAX);
286 if (eq(p, STRLparen)) {
290 stderror(ERR_NAME | ERR_SYNTAX);
293 stderror(ERR_NAME | ERR_MISSING, ')');
306 set1(vp, vecp, &shvhed, flags);
314 cleanup_push(copy, xfree);
315 asx(vp, subscr, copy);
316 cleanup_ignore(copy);
320 setv(vp, Strsave(p), flags);
322 } while ((p = *v++) != NULL);
326 getinx(Char *cp, int *ip)
330 while (*cp && Isdigit(*cp))
331 *ip = *ip * 10 + *cp++ - '0';
333 stderror(ERR_NAME | ERR_SUBSCRIPT);
338 asx(Char *vp, int subscr, Char *p)
340 struct varent *v = getvx(vp, subscr);
343 if (v->v_flags & VAR_READONLY)
344 stderror(ERR_READONLY|ERR_NAME, v->v_name);
345 prev = v->vec[subscr - 1];
346 cleanup_push(prev, xfree);
347 v->vec[subscr - 1] = globone(p, G_APPEND);
351 static struct varent *
352 getvx(Char *vp, int subscr)
354 struct varent *v = adrof(vp);
358 if (subscr < 1 || subscr > blklen(v->vec))
359 stderror(ERR_NAME | ERR_RANGE);
365 dolet(Char **v, struct command *dummy)
383 for (; alnum(*p); p++)
385 if (vp == p || !letter(*vp))
386 stderror(ERR_NAME | ERR_VARBEGIN);
389 p = getinx(p, &subscr);
396 stderror(ERR_NAME | ERR_ASSIGN);
399 * if there is no expression after the '=' then print a "Syntax Error"
402 if (*p == '\0' && *v == NULL)
403 stderror(ERR_NAME | ERR_ASSIGN);
406 cleanup_push(vp, xfree);
415 stderror(ERR_NAME | ERR_UNKNOWNOP);
421 stderror(ERR_NAME | ERR_UNKNOWNOP);
422 stderror(ERR_NAME | ERR_SYNTAX);
425 stderror(ERR_NAME | ERR_UNKNOWNOP);
429 cleanup_push(p, xfree);
434 setv(vp, p, VAR_READWRITE);
438 struct varent *gv = getvx(vp, subscr);
441 val = operate(op, gv->vec[subscr - 1], p);
442 cleanup_push(val, xfree);
443 asx(vp, subscr, val);
450 val = operate(op, varval(vp), p);
451 cleanup_push(val, xfree);
452 setv(vp, val, VAR_READWRITE);
458 } while ((p = *v++) != NULL);
462 xset(Char *cp, Char ***vp)
472 return (putn(expr(vp)));
476 operate(int op, Char *vp, Char *p)
490 if (op == '<' || op == '>')
497 stderror(ERR_NAME | ERR_EXPRESSION);
506 Char nbuf[(CHAR_BIT * sizeof (n) + 2) / 3 + 2]; /* Enough even for octal */
515 return (Strsave(nbuf));
523 *putp++ = n % 10 + '0';
533 if (!cp) /* PWP: extra error checking */
534 stderror(ERR_NAME | ERR_BADNUM);
537 if (cp[0] == '+' && cp[1])
543 stderror(ERR_NAME | ERR_BADNUM);
546 if (cp[0] == '0' && cp[1])
554 if (base == 8 && *cp >= '8')
555 stderror(ERR_NAME | ERR_BADNUM);
556 n = n * base + *cp++ - '0';
559 stderror(ERR_NAME | ERR_BADNUM);
560 return (sign ? -n : n);
564 value1(Char *var, struct varent *head)
568 if (!var || !head) /* PWP: extra error checking */
571 vp = adrof1(var, head);
572 return ((vp == NULL || vp->vec == NULL || vp->vec[0] == NULL) ?
573 STRNULL : vp->vec[0]);
576 static struct varent *
577 madrof(Char *pat, struct varent *vp)
581 for (vp = vp->v_left; vp; vp = vp->v_right) {
582 if (vp->v_left && (vp1 = madrof(pat, vp)) != NULL)
584 if (Gmatch(vp->v_name, pat))
591 adrof1(const Char *name, struct varent *v)
596 while (v && ((cmp = *name - *v->v_name) != 0 ||
597 (cmp = Strcmp(name, v->v_name)) != 0))
606 setcopy(const Char *var, const Char *val, int flags)
611 cleanup_push(copy, xfree);
612 setv(var, copy, flags);
613 cleanup_ignore(copy);
618 * The caller is responsible for putting value in a safe place
621 setv(const Char *var, Char *val, int flags)
623 Char **vec = xmalloc(2 * sizeof(Char **));
627 set1(var, vec, &shvhed, flags);
631 set1(const Char *var, Char **vec, struct varent *head, int flags)
635 if ((flags & VAR_NOGLOB) == 0) {
640 vec = globall(oldv, gflag);
643 stderror(ERR_NAME | ERR_NOMATCH);
649 * Uniqueness addition from: Michael Veksler <mveksler@vnet.ibm.com>
651 if ( flags & (VAR_FIRST | VAR_LAST) ) {
653 * Code for -f (VAR_FIRST) and -l (VAR_LAST) options.
655 * Delete all duplicate words leaving "holes" in the word array (vec).
656 * Then remove the "holes", keeping the order of the words unchanged.
658 if (vec && vec[0] && vec[1]) { /* more than one word ? */
662 for (num_items = 0; vec[num_items]; num_items++)
664 if (flags & VAR_FIRST) {
665 /* delete duplications, keeping first occurance */
666 for (i = 1; i < num_items; i++)
667 for (j = 0; j < i; j++)
668 /* If have earlier identical item, remove i'th item */
669 if (vec[i] && vec[j] && Strcmp(vec[j], vec[i]) == 0) {
674 } else if (flags & VAR_LAST) {
675 /* delete duplications, keeping last occurance */
676 for (i = 0; i < num_items - 1; i++)
677 for (j = i + 1; j < num_items; j++)
678 /* If have later identical item, remove i'th item */
679 if (vec[i] && vec[j] && Strcmp(vec[j], vec[i]) == 0) {
680 /* remove identical item (the first) */
685 /* Compress items - remove empty items */
686 for (j = i = 0; i < num_items; i++)
690 /* NULL-fy remaining items */
691 for (; j < num_items; j++)
694 /* don't let the attribute propagate */
695 flags &= ~(VAR_FIRST|VAR_LAST);
697 setq(var, vec, head, flags);
702 setq(const Char *name, Char **vec, struct varent *p, int flags)
707 f = 0; /* tree hangs off the header's left link */
708 while ((c = p->v_link[f]) != 0) {
709 if ((f = *name - *c->v_name) == 0 &&
710 (f = Strcmp(name, c->v_name)) == 0) {
711 if (c->v_flags & VAR_READONLY)
712 stderror(ERR_READONLY|ERR_NAME, c->v_name);
721 p->v_link[f] = c = xmalloc(sizeof(struct varent));
722 c->v_name = Strsave(name);
725 c->v_left = c->v_right = 0;
733 unset(Char **v, struct command *c)
735 int did_roe, did_edit;
738 did_roe = adrof(STRrecognize_only_executables) != NULL;
739 did_edit = adrof(STRedit) != NULL;
742 #if defined(FILEC) && defined(TIOCSTI)
743 if (adrof(STRfilec) == 0)
745 #endif /* FILEC && TIOCSTI */
747 if (adrof(STRhistchars) == 0) {
751 if (adrof(STRignoreeof) == 0)
753 if (adrof(STRpromptchars) == 0) {
757 if (adrof(STRhistlit) == 0)
759 if (adrof(STRloginsh) == 0)
761 if (adrof(STRwordchars) == 0)
762 word_chars = STR_WORD_CHARS;
763 if (adrof(STRedit) == 0)
765 if (adrof(STRbackslash_quote) == 0)
767 if (adrof(STRcompat_expr) == 0)
769 if (adrof(STRsymlinks) == 0)
771 if (adrof(STRimplicitcd) == 0)
773 if (adrof(STRkillring) == 0)
775 if (did_edit && noediting && adrof(STRedit) == 0)
777 if (did_roe && adrof(STRrecognize_only_executables) == 0)
780 if (adrof(STRcolor) == 0)
782 #endif /* COLOR_LS_F */
783 #if defined(KANJI) && defined(SHORT_STRINGS) && defined(DSPMBYTE)
784 update_dspmbyte_vars();
789 #endif /* NLS_CATALOGS */
793 unset1(Char *v[], struct varent *head)
800 while ((vp = madrof(*v, head)) != NULL)
801 if (vp->v_flags & VAR_READONLY)
802 stderror(ERR_READONLY|ERR_NAME, vp->v_name);
806 setname(short2str(*v));
815 if ((vp = adrof1(var, &shvhed)) == 0)
821 unsetv1(struct varent *p)
823 struct varent *c, *pp;
827 * Free associated memory first to avoid complications.
832 * If p is missing one child, then we can move the other into where p is.
833 * Otherwise, we find the predecessor of p, which is guaranteed to have no
834 * right child, copy it into p, and move it's left child into it.
838 else if (p->v_left == 0)
841 for (c = p->v_left; c->v_right; c = c->v_right)
843 p->v_name = c->v_name;
844 p->v_flags = c->v_flags;
851 * Move c into where p is.
854 f = pp->v_right == p;
855 if ((pp->v_link[f] = c) != 0)
858 * Free the deleted node, and rebalance.
867 setcopy(cp, STRNULL, VAR_READWRITE);
872 shift(Char **v, struct command *c)
885 if (argv == NULL || argv->vec == NULL)
887 if (argv->vec[0] == 0)
888 stderror(ERR_NAME | ERR_NOMORE);
889 lshift(argv->vec, 1);
894 exportpath(Char **val)
896 struct Strbuf buf = Strbuf_INIT;
901 Strbuf_append(&buf, *val++);
902 if (*val == 0 || eq(*val, STRRparen))
904 Strbuf_append1(&buf, PATHSEP);
906 exppath = Strbuf_finish(&buf);
907 cleanup_push(exppath, xfree);
908 tsetenv(STRKPATH, exppath);
909 cleanup_until(exppath);
914 * Lint thinks these have null effect
916 /* macros to do single rotations on node p */
917 # define rright(p) (\
919 (t)->v_parent = (p)->v_parent,\
920 (((p)->v_left = t->v_right) != NULL) ?\
921 (t->v_right->v_parent = (p)) : 0,\
922 (t->v_right = (p))->v_parent = t,\
926 ((t)->v_parent = (p)->v_parent,\
927 ((p)->v_right = t->v_left) != NULL) ? \
928 (t->v_left->v_parent = (p)) : 0,\
929 (t->v_left = (p))->v_parent = t,\
932 static struct varent *
933 rleft(struct varent *p)
937 static struct varent *
938 rright(struct varent *p)
947 * Rebalance a tree, starting at p and up.
948 * F == 0 means we've come from p's left child.
949 * D == 1 means we've just done a delete, otherwise an insert.
952 balance(struct varent *p, int f, int d)
957 struct varent *t; /* used by the rotate macros */
961 ff = 0; /* Sun's lint is dumb! */
965 * Ok, from here on, p is the node we're operating on; pp is it's parent; f
966 * is the branch of p from which we have come; ff is the branch of pp which
969 for (; (pp = p->v_parent) != 0; p = pp, f = ff) {
970 ff = pp->v_right == p;
971 if (f ^ d) { /* right heavy */
973 case -1: /* was left heavy */
976 case 0: /* was balanced */
979 case 1: /* was already right heavy */
980 switch (p->v_right->v_bal) {
981 case 1: /* single rotate */
982 pp->v_link[ff] = rleft(p);
983 p->v_left->v_bal = 0;
986 case 0: /* single rotate */
987 pp->v_link[ff] = rleft(p);
988 p->v_left->v_bal = 1;
991 case -1: /* double rotate */
992 (void) rright(p->v_right);
993 pp->v_link[ff] = rleft(p);
995 p->v_bal < 1 ? 0 : -1;
997 p->v_bal > -1 ? 0 : 1;
1008 else { /* left heavy */
1010 case 1: /* was right heavy */
1013 case 0: /* was balanced */
1016 case -1: /* was already left heavy */
1017 switch (p->v_left->v_bal) {
1018 case -1: /* single rotate */
1019 pp->v_link[ff] = rright(p);
1020 p->v_right->v_bal = 0;
1023 case 0: /* single rotate */
1024 pp->v_link[ff] = rright(p);
1025 p->v_right->v_bal = -1;
1028 case 1: /* double rotate */
1029 (void) rleft(p->v_left);
1030 pp->v_link[ff] = rright(p);
1032 p->v_bal < 1 ? 0 : -1;
1034 p->v_bal > -1 ? 0 : 1;
1046 * If from insert, then we terminate when p is balanced. If from
1047 * delete, then we terminate when p is unbalanced.
1049 if ((p->v_bal == 0) ^ d)
1055 plist(struct varent *p, int what)
1064 if (p->v_parent == 0) /* is it the header? */
1066 if ((p->v_flags & what) != 0) {
1068 int old_pintr_disabled;
1070 pintr_push_enable(&old_pintr_disabled);
1071 cleanup_until(&old_pintr_disabled);
1073 len = blklen(p->vec);
1074 xprintf("%S\t", p->v_name);
1089 } while (p->v_right == c);
1094 #if defined(KANJI) && defined(SHORT_STRINGS) && defined(DSPMBYTE)
1095 extern int dspmbyte_ls;
1098 update_dspmbyte_vars(void)
1104 /* if variable "nokanji" is set, multi-byte display is disabled */
1105 if ((vp = adrof(CHECK_MBYTEVAR)) && !adrof(STRnokanji)) {
1108 if(eq (dstr1, STRsjis))
1110 else if (eq(dstr1, STReuc))
1112 else if (eq(dstr1, STRbig5))
1114 else if (eq(dstr1, STRutf8))
1116 else if ((dstr1[0] - '0') >= 0 && (dstr1[0] - '0') <= 3) {
1120 xprintf(CGETS(18, 2,
1121 "Warning: unknown multibyte display; using default(euc(JP))\n"));
1124 if (dstr1 && vp->vec[1] && eq(vp->vec[1], STRls))
1128 for (lp = 0; lp < 256 && iskcode > 0; lp++) {
1132 _cmap[lp] = _cmap_mbyte[lp];
1133 _mbmap[lp] = _mbmap_sjis[lp];
1137 _cmap[lp] = _cmap_mbyte[lp];
1138 _mbmap[lp] = _mbmap_euc[lp];
1142 _cmap[lp] = _cmap_mbyte[lp];
1143 _mbmap[lp] = _mbmap_big5[lp];
1147 _cmap[lp] = _cmap_mbyte[lp];
1148 _mbmap[lp] = _mbmap_utf8[lp];
1151 xprintf(CGETS(18, 3,
1152 "Warning: unknown multibyte code %d; multibyte disabled\n"),
1154 _cmap[lp] = _cmap_c[lp];
1155 _mbmap[lp] = 0; /* Default map all 0 */
1161 /* check original table */
1162 if (Strlen(dstr1) != 256) {
1163 xprintf(CGETS(18, 4,
1164 "Warning: Invalid multibyte table length (%d); multibyte disabled\n"),
1168 for (lp = 0; lp < 256 && _enable_mbdisp == 1; lp++) {
1169 if (!((dstr1[lp] - '0') >= 0 && (dstr1[lp] - '0') <= 3)) {
1170 xprintf(CGETS(18, 4,
1171 "Warning: bad multibyte code at offset +%d; multibyte diabled\n"),
1177 /* set original table */
1178 for (lp = 0; lp < 256; lp++) {
1179 if (_enable_mbdisp == 1) {
1180 _cmap[lp] = _cmap_mbyte[lp];
1181 _mbmap[lp] = (unsigned short) ((dstr1[lp] - '0') & 0x0f);
1184 _cmap[lp] = _cmap_c[lp];
1185 _mbmap[lp] = 0; /* Default map all 0 */
1191 for (lp = 0; lp < 256; lp++) {
1192 _cmap[lp] = _cmap_c[lp];
1193 _mbmap[lp] = 0; /* Default map all 0 */
1198 #ifdef MBYTEDEBUG /* Sorry, use for beta testing */
1201 for (lp = 0; lp < 256; lp++)
1202 mbmapstr[lp] = _mbmap[lp] + '0';
1204 setcopy(STRmbytemap, mbmapstr, VAR_READWRITE);
1206 #endif /* MBYTEMAP */
1209 /* dspkanji/dspmbyte autosetting */
1210 /* PATCH IDEA FROM Issei.Suzuki VERY THANKS */
1212 autoset_dspmbyte(const Char *pcp)
1215 static const struct dspm_autoset_Table {
1219 { STRLANGEUCJP, STReuc },
1220 { STRLANGEUCKR, STReuc },
1221 { STRLANGEUCZH, STReuc },
1222 { STRLANGEUCJPB, STReuc },
1223 { STRLANGEUCKRB, STReuc },
1224 { STRLANGEUCZHB, STReuc },
1226 { STRLANGEUCJPC, STReuc },
1228 { STRLANGSJIS, STRsjis },
1229 { STRLANGSJISB, STRsjis },
1230 { STRLANGBIG5, STRbig5 },
1231 { STRstarutfstar8, STRutf8 },
1234 #if defined(HAVE_NL_LANGINFO) && defined(CODESET)
1235 static const struct dspm_autoset_Table dspmc[] = {
1236 { STRstarutfstar8, STRutf8 },
1238 { STRGB2312, STReuc },
1239 { STRLANGBIG5, STRbig5 },
1244 codeset = str2short(nl_langinfo(CODESET));
1245 if (*codeset != '\0') {
1246 for (i = 0; dspmc[i].n; i++) {
1248 if (dspmc[i].n[0] && t_pmatch(pcp, dspmc[i].n, &estr, 0) > 0) {
1249 setcopy(CHECK_MBYTEVAR, dspmc[i].v, VAR_READWRITE);
1250 update_dspmbyte_vars();
1260 for (i = 0; dspmt[i].n; i++) {
1262 if (dspmt[i].n[0] && t_pmatch(pcp, dspmt[i].n, &estr, 0) > 0) {
1263 setcopy(CHECK_MBYTEVAR, dspmt[i].v, VAR_READWRITE);
1264 update_dspmbyte_vars();