Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: Re: zsh: can't find terminal definition on vt100



Bart Schaefer wrote:
>--- Src/init.c	2001/10/22 17:03:58	1.7
>+++ Src/init.c	2002/02/12 16:40:47
>@@ -535,11 +535,15 @@
> 
> #ifdef TGETENT_ACCEPTS_NULL
>     /* If possible, we let tgetent allocate its own termcap buffer */
>-    if (tgetent(NULL, term) != 1) {
>+# ifdef TGETENT_ZERO_SUCCESS
>+    if (tgetent(NULL, term) != 0)
>+# else
>+    if (tgetent(NULL, term) != 1)
>+# endif
> #else
>-    if (tgetent(termbuf, term) != 1) {
>+    if (tgetent(termbuf, term) != 1)
> #endif
>-
>+    {

Surely these two conditions are orthogonal -- your configure tests are
orthogonal -- so we really want code like

      if (
  #ifdef TGETENT_ACCEPTS_NULL
          tgetent(NULL, term)
  #else
          tgetent(termbuf, term)
  #endif
  #ifdef TGETENT_ZERO_SUCCESS
                              != 0
  #else
                              != 1
  #endif
                                  ) {

Or, of course, make it clearer by defining macros for TGETENT_SUCCESS etc.

-zefram



Messages sorted by: Reverse Date, Date, Thread, Author