1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-05-25 17:36:16 +02:00

users/13418: protect against have_strcodes lying

This commit is contained in:
Peter Stephenson 2008-10-30 09:52:15 +00:00
parent 787c86f68d
commit db68b7270f
2 changed files with 13 additions and 2 deletions

View File

@ -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>
* 25949: Src/Zle/zle_hist.c: remove dead code in getvisrchstr.

View File

@ -235,7 +235,7 @@ scantermcap(UNUSED(HashTable ht), ScanFunc func, int flags)
#endif
#ifndef HAVE_STRCODES
static char *strcodes[] = {
static char *zstrcodes[] = {
"ac", "bt", "bl", "cr", "ZA", "ZB", "ZC", "ZD", "cs", "rP", "ct",
"MC", "cl", "cb", "ce", "cd", "ch", "CC", "CW", "cm", "do", "ho",
"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->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 &&
tcstr != (char *)-1) {
pm->u.str = dupstring(tcstr);