mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-10 12:40:58 +02:00
users/13418: protect against have_strcodes lying
This commit is contained in:
parent
787c86f68d
commit
db68b7270f
2 changed files with 13 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2008-10-30 Peter Stephenson <pws@csr.com>
|
||||||
|
|
||||||
|
* users/13418: Src/Modules/termcap.c: protect against
|
||||||
|
HAVE_STRCODES lying.
|
||||||
|
|
||||||
2008-10-30 Clint Adams <clint@zsh.org>
|
2008-10-30 Clint Adams <clint@zsh.org>
|
||||||
|
|
||||||
* 25949: Src/Zle/zle_hist.c: remove dead code in getvisrchstr.
|
* 25949: Src/Zle/zle_hist.c: remove dead code in getvisrchstr.
|
||||||
|
|
|
@ -235,7 +235,7 @@ scantermcap(UNUSED(HashTable ht), ScanFunc func, int flags)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_STRCODES
|
#ifndef HAVE_STRCODES
|
||||||
static char *strcodes[] = {
|
static char *zstrcodes[] = {
|
||||||
"ac", "bt", "bl", "cr", "ZA", "ZB", "ZC", "ZD", "cs", "rP", "ct",
|
"ac", "bt", "bl", "cr", "ZA", "ZB", "ZC", "ZD", "cs", "rP", "ct",
|
||||||
"MC", "cl", "cb", "ce", "cd", "ch", "CC", "CW", "cm", "do", "ho",
|
"MC", "cl", "cb", "ce", "cd", "ch", "CC", "CW", "cm", "do", "ho",
|
||||||
"vi", "le", "CM", "ve", "nd", "ll", "up", "vs", "ZE", "dc", "dl",
|
"vi", "le", "CM", "ve", "nd", "ll", "up", "vs", "ZE", "dc", "dl",
|
||||||
|
@ -302,7 +302,13 @@ scantermcap(UNUSED(HashTable ht), ScanFunc func, int flags)
|
||||||
pm->node.flags = PM_READONLY | PM_SCALAR;
|
pm->node.flags = PM_READONLY | PM_SCALAR;
|
||||||
pm->gsu.s = &nullsetscalar_gsu;
|
pm->gsu.s = &nullsetscalar_gsu;
|
||||||
|
|
||||||
for (capcode = (char **)strcodes; *capcode; capcode++) {
|
for (capcode = (char **)
|
||||||
|
#ifdef HAVE_STRCODES
|
||||||
|
strcodes
|
||||||
|
#else
|
||||||
|
zstrcodes
|
||||||
|
#endif
|
||||||
|
; *capcode; capcode++) {
|
||||||
if ((tcstr = (char *)tgetstr(*capcode,&u)) != NULL &&
|
if ((tcstr = (char *)tgetstr(*capcode,&u)) != NULL &&
|
||||||
tcstr != (char *)-1) {
|
tcstr != (char *)-1) {
|
||||||
pm->u.str = dupstring(tcstr);
|
pm->u.str = dupstring(tcstr);
|
||||||
|
|
Loading…
Reference in a new issue