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

Re: PATCH: termcap/terminfo support in modules



> The culprit appears to be tigetstr(s) on Solaris 2.6 returning 0xffffffff,
> which looks a lot like -1.  Indeed, although the manual entry claims
> blithely at the end `routines that return pointers always return NULL on
> error', it seems this returns -1 to indicate `not a string value'.

The same applies to $terminfo:

Index: Src/Modules/terminfo.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/terminfo.c,v
retrieving revision 1.3
diff -u -r1.3 terminfo.c
--- Src/Modules/terminfo.c	2000/12/05 11:00:08	1.3
+++ Src/Modules/terminfo.c	2000/12/06 01:01:45
@@ -165,7 +165,7 @@
 	pm->u.str = num ? dupstring("yes") : dupstring("no");
 	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->flags |= PM_SCALAR;



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