summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libcurses/tinfo/read_bsd_terminfo.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/lib/libcurses/tinfo/read_bsd_terminfo.c b/lib/libcurses/tinfo/read_bsd_terminfo.c
index ef57727825c..8446b4877c5 100644
--- a/lib/libcurses/tinfo/read_bsd_terminfo.c
+++ b/lib/libcurses/tinfo/read_bsd_terminfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: read_bsd_terminfo.c,v 1.5 1999/03/02 06:23:29 millert Exp $ */
+/* $OpenBSD: read_bsd_terminfo.c,v 1.6 1999/12/28 23:15:16 millert Exp $ */
/*
* Copyright (c) 1998, 1999 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: read_bsd_terminfo.c,v 1.5 1999/03/02 06:23:29 millert Exp $";
+static char rcsid[] = "$OpenBSD: read_bsd_terminfo.c,v 1.6 1999/12/28 23:15:16 millert Exp $";
#endif
#include <curses.priv.h>
@@ -174,25 +174,16 @@ _nc_lookup_bsd_terminfo_entry(tn, filename, tp)
if (strlen(p) > MAX_ALIAS)
_nc_warning("alias `%s' may be too long", p);
- /* Copy capabilities */
- for_each_boolean(i, tp) {
- if (cgetcap(capbuf, (char *)boolnames[i], ':') == NULL)
- tp->Booleans[i] = FALSE;
- else
+ /* Copy existing capabilities */
+ for_each_boolean(i, tp)
+ if (cgetcap(capbuf, (char *)boolnames[i], ':') != NULL)
tp->Booleans[i] = TRUE;
- }
- for_each_number(i, tp) {
- if (cgetnum(capbuf, (char *)numnames[i], &num) < 0)
- tp->Numbers[i] = 0;
- else
- tp->Numbers[i] = (int)num;
- }
- for_each_string(i, tp) {
- if (cgetstr(capbuf, (char *)strnames[i], &p) < 0)
- tp->Strings[i] = NULL;
- else
+ for_each_number(i, tp)
+ if (cgetnum(capbuf, (char *)numnames[i], &num) == 0)
+ tp->Numbers[i] = (short)num;
+ for_each_string(i, tp)
+ if (cgetstr(capbuf, (char *)strnames[i], &p) >= 0)
tp->Strings[i] = p;
- }
i = 0;
}