Fri May 16 18:49:46 2003

On Sun Solaris 8 and 9, if dired is compiled with c89, it gets linked
with /usr/xpg4/lib/libcurses.so.2, and the first call to tgetent()
produces a segment violation.  This seems to be a bug, since it can be
reproduced with this simple test program:

	% cat tgetent-bug.c
	#include <stdio.h>
	#include <stdlib.h>
	#include <curses.h>
	#include <term.h>

	int
	main(int argc, char* argv[])
	{
	    char tbuf[10240];
	    int n;

	    n = tgetent(tbuf, "xterm");
	    printf("tgetent() returned %d\n", n);
	    return (EXIT_SUCCESS);
	}

	% c89 tgetent-bug.c -lcurses && ./a.out
	Segmentation fault (core dumped)

	% ldd a.out
		libcurses.so.2 =>        /usr/xpg4/lib/libcurses.so.2
		libc.so.1 =>     /usr/lib/libc.so.1
		libdl.so.1 =>    /usr/lib/libdl.so.1
		/usr/platform/SUNW,Sun-Blade-100/lib/libc_psr.so.1

Linking with other libraries works:

	% c89 tgetent-bug.c -lncurses && ./a.out
	tgetent() returned 1

	% c89 tgetent-bug.c -ltermcap && ./a.out
	tgetent() returned 1

	% c89 tgetent-bug.c -ltermlib && ./a.out
	tgetent() returned 1

The solution is to override the default choice of -lcurses:

	make LIBS=-ltermlib

I have yet to decide how to automate this.
------------------------------------------------------------------------
Fri May 16 18:46:03 2003

On OpenBSD 3.2 and NetBSD 1.6, there is a third flavor of terminal
capabilities: terminfo.db, a database of terminfo data (instead of a
file tree).   Linking with -lcurses (/usr/lib/libcurses.*) or
-lncurses (/usr/local/lib/libncurses.*) produces a dired that cannot
find terminal capabilities, unless they are available under
$HOME/.terminfo/[a-z]/[a-z]*.

At dired version 4.04.2 and earlier, configure gives preference to
-lcurses.  Therefore, to get a properly working dired, this override
is necessary:

	make LIBS=-ltermlib

I have yet to decide how to automate this.
------------------------------------------------------------------------
Wed Aug  5 18:56:16 1998
A

	dired -s $B

core dumped; correcting it to -sw fixed the problem
