diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2005-07-19 14:01:01 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2005-07-19 14:01:01 +0000 |
commit | 07932e16b7979ac258d038c5fc95a135a831fd6e (patch) | |
tree | 9331487e8a485432f255be7bd51784d33969f38f /lib/libcurses/tinfo | |
parent | 53cceb8ce5f633b3400df35e4d1a0750f455c6cb (diff) |
Convert return value of cgetent(3) to what the curses routines expect.
Fixes a problem where an unknown terminal type would be reported as
"database not found". Noticed by grunk@
Diffstat (limited to 'lib/libcurses/tinfo')
-rw-r--r-- | lib/libcurses/tinfo/read_termcap.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libcurses/tinfo/read_termcap.c b/lib/libcurses/tinfo/read_termcap.c index a11f04ec350..f48ffcead66 100644 --- a/lib/libcurses/tinfo/read_termcap.c +++ b/lib/libcurses/tinfo/read_termcap.c @@ -920,6 +920,7 @@ _nc_read_termcap_entry #endif #if USE_GETCAP char *p, tc[TBUFSIZ]; + int status; static char *source; static int lineno; @@ -930,8 +931,8 @@ _nc_read_termcap_entry _nc_set_source("TERMCAP"); } else { /* we're using getcap(3) */ - if (_nc_tgetent(tc, &source, &lineno, tn) < 0) - return (ERR); + if ((status = _nc_tgetent(tc, &source, &lineno, tn)) < 0) + return (status == -1 ? 0 : -1); _nc_curr_line = lineno; _nc_set_source(source); |