summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/Modules/termcap.c10
2 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 90e3565b2..0a107e86d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/Src/Modules/termcap.c b/Src/Modules/termcap.c
index 776351cf6..5e4cfa07f 100644
--- a/Src/Modules/termcap.c
+++ b/Src/Modules/termcap.c
@@ -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);