diff options
author | mp <mp@FreeBSD.org> | 2004-07-11 02:17:56 +0000 |
---|---|---|
committer | mp <mp@FreeBSD.org> | 2004-07-11 02:17:56 +0000 |
commit | bbd1addf8f9452690ad13ce5b875ee4cc9633958 (patch) | |
tree | 730792f0cc19f3bb4fb663fe727589381f5901be /contrib/tcsh/sh.set.c | |
parent | f2c2aa29b7d05c53575ab7ce4dc5870fd33a1310 (diff) | |
download | FreeBSD-src-bbd1addf8f9452690ad13ce5b875ee4cc9633958.zip FreeBSD-src-bbd1addf8f9452690ad13ce5b875ee4cc9633958.tar.gz |
Import of tcsh-6.13.00
Diffstat (limited to 'contrib/tcsh/sh.set.c')
-rw-r--r-- | contrib/tcsh/sh.set.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/contrib/tcsh/sh.set.c b/contrib/tcsh/sh.set.c index 531da30..afb92f4 100644 --- a/contrib/tcsh/sh.set.c +++ b/contrib/tcsh/sh.set.c @@ -1,4 +1,4 @@ -/* $Header: /src/pub/tcsh/sh.set.c,v 3.44 2002/07/01 20:50:22 christos Exp $ */ +/* $Header: /src/pub/tcsh/sh.set.c,v 3.48 2004/03/21 16:48:14 christos Exp $ */ /* * sh.set.c: Setting and Clearing of variables */ @@ -32,13 +32,14 @@ */ #include "sh.h" -RCSID("$Id: sh.set.c,v 3.44 2002/07/01 20:50:22 christos Exp $") +RCSID("$Id: sh.set.c,v 3.48 2004/03/21 16:48:14 christos Exp $") #include "ed.h" #include "tw.h" extern Char HistLit; extern bool GotTermCaps; +int numeof = 0; static void update_vars __P((Char *)); static Char *getinx __P((Char *, int *)); @@ -122,7 +123,7 @@ update_vars(vp) ed_Init(); /* reset the editor */ } else if (eq(vp, STRhome)) { - register Char *cp; + Char *cp; cp = Strsave(varval(vp)); /* get the old value back */ @@ -147,6 +148,18 @@ update_vars(vp) else if (eq(vp, STRshlvl)) { tsetenv(STRKSHLVL, varval(vp)); } + else if (eq(vp, STRignoreeof)) { + Char *cp; + numeof = 0; + for ((cp = varval(STRignoreeof)); cp && *cp; cp++) { + if (!Isdigit(*cp)) { + numeof = 0; + break; + } + numeof = numeof * 10 + *cp - '0'; + } + if (numeof <= 0) numeof = 26; /* Sanity check */ + } else if (eq(vp, STRbackslash_quote)) { bslash_quote = 1; } @@ -732,6 +745,8 @@ unset(v, c) HIST = '!'; HISTSUB = '^'; } + if (adrof(STRignoreeof) == 0) + numeof = 0; if (adrof(STRpromptchars) == 0) { PRCH = '>'; PRCHROOT = '#'; @@ -1230,9 +1245,13 @@ autoset_dspmbyte(pcp) { STRLANGEUCJPB, STRKEUC }, { STRLANGEUCKRB, STRKEUC }, { STRLANGEUCZHB, STRKEUC }, +#ifdef linux + { STRLANGEUCJPC, STRKEUC }, +#endif { STRLANGSJIS, STRKSJIS }, { STRLANGSJISB, STRKSJIS }, { STRLANGBIG5, STRKBIG5 }, + { STRSTARKUTF8, STRKUTF8 }, { NULL, NULL } }; @@ -1240,7 +1259,8 @@ autoset_dspmbyte(pcp) return; for (i = 0; dspmt[i].n; i++) { - if (eq(pcp, dspmt[i].n)) { + Char *estr; + if (t_pmatch(pcp, dspmt[i].n, &estr, 1) > 0) { set(CHECK_MBYTEVAR, Strsave(dspmt[i].v), VAR_READWRITE); update_dspmbyte_vars(); break; |