diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-05-12 04:49:46 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-05-12 04:49:46 +0000 |
commit | ea0ddb0fc6073be3d7d289e59b083f564dbd761f (patch) | |
tree | d1e3f1be8624d47e7e8a75838f9e84885a17a484 /Src/params.c | |
parent | 53d36e795b26a945048e7a87a1a91224f8e1663a (diff) | |
download | zsh-ea0ddb0fc6073be3d7d289e59b083f564dbd761f.tar.gz zsh-ea0ddb0fc6073be3d7d289e59b083f564dbd761f.tar.xz zsh-ea0ddb0fc6073be3d7d289e59b083f564dbd761f.zip |
pws-18 dot-zsh-199905171944
Diffstat (limited to 'Src/params.c')
-rw-r--r-- | Src/params.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/Src/params.c b/Src/params.c index d60f91990..a8b027988 100644 --- a/Src/params.c +++ b/Src/params.c @@ -270,6 +270,7 @@ newparamtable(int size, char const *name) ht->hash = hasher; ht->emptytable = emptyhashtable; ht->filltable = NULL; + ht->cmpnodes = strcmp; ht->addnode = addhashnode; ht->getnode = getparamnode; ht->getnode2 = getparamnode; @@ -282,6 +283,7 @@ newparamtable(int size, char const *name) return ht; } +/**/ #ifdef DYNAMIC /**/ static HashNode @@ -299,6 +301,7 @@ getparamnode(HashTable ht, char *nam) } return hn; } +/**/ #endif /* DYNAMIC */ /* Copy a parameter hash table */ @@ -1753,7 +1756,7 @@ unsetparam_pm(Param pm, int altflag, int exp) * Some specials, such as those used in zle, still need removing * from the parameter table; they have the PM_REMOVABLE flag. */ - if ((locallevel && locallevel >= pm->level) || + if ((pm->level && locallevel >= pm->level) || (pm->flags & (PM_SPECIAL|PM_REMOVABLE)) == PM_SPECIAL) return; @@ -1963,23 +1966,11 @@ intvarsetfn(Param pm, long x) void zlevarsetfn(Param pm, long x) { - if ((long *)pm->u.data == & columns) { - if(x <= 0) - x = tccolumns > 0 ? tccolumns : 80; - if (x > 2) - termflags &= ~TERM_NARROW; - else - termflags |= TERM_NARROW; - } else if ((long *)pm->u.data == & lines) { - if(x <= 0) - x = tclines > 0 ? tclines : 24; - if (x > 2) - termflags &= ~TERM_SHORT; - else - termflags |= TERM_SHORT; - } + long *p = (long *)pm->u.data; - *((long *)pm->u.data) = x; + *p = x; + if (p == &lines || p == &columns) + adjustwinsize(2 + (p == &columns)); } /* Function to set value of generic special scalar * |