summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/Modules/termcap.c28
2 files changed, 19 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index e477fdd60..f9d01ef5b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2001-04-21 Bart Schaefer <schaefer@zsh.org>
+ * 14062: Src/Modules/termcap.c: Avoid including both old-style
+ termcap.h and ncurses term.h at the same time (see 13965).
+
* 14060: Src/builtin.c, Src/lex.c, Src/params.c,
Test/D06subscript.ztst: Fix problem with ${array[ix]=value}
introduced by 14008; fix long-standing problems with
diff --git a/Src/Modules/termcap.c b/Src/Modules/termcap.c
index 35fb71f64..fbaf887c1 100644
--- a/Src/Modules/termcap.c
+++ b/Src/Modules/termcap.c
@@ -37,20 +37,22 @@ static char termcap_nam[] = "termcap";
/* echotc: output a termcap */
#ifdef HAVE_TGETENT
-# ifdef HAVE_TERMCAP_H
-# include <termcap.h>
-# ifdef HAVE_TERM_H
-# include <term.h>
-# endif
-# else
+# if defined(HAVE_CURSES_H) && defined(HAVE_TERM_H)
# ifdef HAVE_TERMIO_H
# include <termio.h>
# endif
-# ifdef HAVE_CURSES_H
-# include <curses.h>
-# endif
-# ifdef HAVE_TERM_H
-# include <term.h>
+# include <curses.h>
+# include <term.h>
+# else
+# ifdef HAVE_TERMCAP_H
+# include <termcap.h>
+# else
+# ifdef HAVE_CURSES_H
+# include <curses.h>
+# endif
+# ifdef HAVE_TERM_H
+# include <term.h>
+# endif
# endif
# endif
@@ -356,7 +358,9 @@ int
boot_(Module m)
{
#ifdef HAVE_TGETENT
+# if defined(HAVE_CURSES_H) && defined(HAVE_TERM_H)
setupterm((char *)0, 1, (int *)0);
+# endif
if (!createtchash())
return 1;
@@ -376,7 +380,7 @@ cleanup_(Module m)
incleanup = 1;
-#ifdef HAVE_TGETENTR
+#ifdef HAVE_TGETENT
if ((pm = (Param) paramtab->getnode(paramtab, termcap_nam)) &&
pm == termcap_pm) {
pm->flags &= ~PM_READONLY;