aboutsummaryrefslogtreecommitdiff
path: root/contrib/ncurses/ncurses/tinfo/read_termcap.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2001-05-17 08:21:06 +0000
committerPeter Wemm <peter@FreeBSD.org>2001-05-17 08:21:06 +0000
commit7a69bbfb278952228c9aa1eca241e65fcdef425e (patch)
treee83b2ef47811e687a6c54035c9af6d4a2b7f14e1 /contrib/ncurses/ncurses/tinfo/read_termcap.c
parent18259542b2f8fa7e3f76f4bb0dd37995dfd424aa (diff)
downloadsrc-7a69bbfb278952228c9aa1eca241e65fcdef425e.tar.gz
src-7a69bbfb278952228c9aa1eca241e65fcdef425e.zip
Import ncurses-5.2-20010512 onto the vendor branch
Obtained from: ftp://dickey.his.com/ncurses/
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=76726
Diffstat (limited to 'contrib/ncurses/ncurses/tinfo/read_termcap.c')
-rw-r--r--contrib/ncurses/ncurses/tinfo/read_termcap.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/contrib/ncurses/ncurses/tinfo/read_termcap.c b/contrib/ncurses/ncurses/tinfo/read_termcap.c
index f74c5a1eb760..da88f0b149ab 100644
--- a/contrib/ncurses/ncurses/tinfo/read_termcap.c
+++ b/contrib/ncurses/ncurses/tinfo/read_termcap.c
@@ -55,7 +55,7 @@
#include <tic.h>
#include <term_entry.h>
-MODULE_ID("$Id: read_termcap.c,v 1.50 2000/10/10 00:56:46 Todd.Miller Exp $")
+MODULE_ID("$Id: read_termcap.c,v 1.55 2000/12/10 02:55:08 tom Exp $")
#if !PURE_TERMINFO
@@ -770,7 +770,7 @@ _nc_tgetent(char *bp, char **sourcename, int *lineno, const char *name)
register char *p;
register char *cp;
- char *dummy;
+ char *dummy = NULL;
char **fname;
char *home;
int i;
@@ -784,7 +784,7 @@ _nc_tgetent(char *bp, char **sourcename, int *lineno, const char *name)
pvec = pathvec;
tbuf = bp;
p = pathbuf;
- cp = use_terminfo_vars() ? getenv("TERMCAP") : NULL;
+ cp = use_terminfo_vars()? getenv("TERMCAP") : NULL;
/*
* TERMCAP can have one of two things in it. It can be the name of a file
@@ -821,10 +821,10 @@ _nc_tgetent(char *bp, char **sourcename, int *lineno, const char *name)
*fname++ = pathbuf; /* tokenize path into vector of names */
while (*++p) {
- if (*p == ' ' || *p == ':') {
+ if (*p == ' ' || *p == NCURSES_PATHSEP) {
*p = '\0';
while (*++p)
- if (*p != ' ' && *p != ':')
+ if (*p != ' ' && *p != NCURSES_PATHSEP)
break;
if (*p == '\0')
break;
@@ -917,8 +917,9 @@ add_tc(char *termpaths[], char *path, int count)
#define ADD_TC(path, count) filecount = add_tc(termpaths, path, count)
#endif /* !USE_GETCAP */
-int
-_nc_read_termcap_entry(const char *const tn, TERMTYPE * const tp)
+NCURSES_EXPORT(int)
+_nc_read_termcap_entry
+(const char *const tn, TERMTYPE * const tp)
{
int found = FALSE;
ENTRY *ep;
@@ -990,7 +991,7 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE * const tp)
char *cp;
for (cp = tc; *cp; cp++) {
- if (*cp == ':')
+ if (*cp == NCURSES_PATHSEP)
*cp = '\0';
else if (cp == tc || cp[-1] == '\0') {
ADD_TC(cp, filecount);
@@ -1013,7 +1014,7 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE * const tp)
#define PRIVATE_CAP "%s/.termcap"
- if ((h = getenv("HOME")) != NULL && *h != '\0'
+ if (use_terminfo_vars() && (h = getenv("HOME")) != NULL && *h != '\0'
&& (strlen(h) + sizeof(PRIVATE_CAP)) < PATH_MAX) {
/* user's .termcap, if any, should override it */
(void) strcpy(envhome, h);
@@ -1103,8 +1104,10 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE * const tp)
return (found);
}
#else
-extern void _nc_read_termcap(void);
-void
+extern
+NCURSES_EXPORT(void)
+_nc_read_termcap(void);
+NCURSES_EXPORT(void)
_nc_read_termcap(void)
{
}