1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-19 21:44:11 +01:00

13242: don't segfault on $terminfo[nonexistentcap]

This commit is contained in:
Clint Adams 2000-12-06 01:16:12 +00:00
parent fade355d03
commit 9ff637aea0
2 changed files with 6 additions and 1 deletions

@ -1,3 +1,8 @@
2000-12-05 Clint Adams <schizo@debian.org>
* 13242: Src/Modules/terminfo.c: better error-checking
for non-existent capabilities referenced by $terminfo.
2000-12-05 Peter Stephenson <pws@csr.com> 2000-12-05 Peter Stephenson <pws@csr.com>
* unposted: Config/version.mk: 3.1.9-dev-8. * unposted: Config/version.mk: 3.1.9-dev-8.

@ -165,7 +165,7 @@ getterminfo(HashTable ht, char *name)
pm->u.str = num ? dupstring("yes") : dupstring("no"); pm->u.str = num ? dupstring("yes") : dupstring("no");
pm->flags |= PM_SCALAR; pm->flags |= PM_SCALAR;
} }
else if ((tistr = (char *)tigetstr(name)) != NULL) else if ((tistr = (char *)tigetstr(name)) != NULL && tistr != (char *)-1)
{ {
pm->u.str = dupstring(tistr); pm->u.str = dupstring(tistr);
pm->flags |= PM_SCALAR; pm->flags |= PM_SCALAR;