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

Re: PATCH: termcap/terminfo support in modules

> A bigger problem is that the configure variable is wrongly named.

Sorry to keep sending short messages on the same thing, but:

% echoti foo
zsh: segmentation fault (core dumped)  zsh

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'.

Index: Src/Modules/terminfo.c
RCS file: /cvsroot/zsh/zsh/Src/Modules/terminfo.c,v
retrieving revision 1.2
diff -u -r1.2 terminfo.c
--- Src/Modules/terminfo.c	2000/12/05 00:28:46	1.2
+++ Src/Modules/terminfo.c	2000/12/05 10:55:33
@@ -67,7 +67,7 @@
 /* get a string-type capability */
     t = (char *)tigetstr(s);
-    if (!t || !*t) {
+    if (!t || t == (char *)-1 || !*t) {
 	/* capability doesn't exist, or (if boolean) is off */
 	zwarnnam(name, "no such terminfo capability: %s", s, 0);
 	return 1;

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070

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