From e5f47b7ade4183fa339330d7ad69d934da5519e2 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Thu, 11 May 1989 05:41:11 -0800 Subject: [PATCH] file reorg, pathnames.h, paths.h SCCS-vsn: lib/libterm/Makefile 5.7 SCCS-vsn: lib/libterm/termcap.c 5.4 --- usr/src/lib/libterm/Makefile | 18 +++++++++++------- usr/src/lib/libterm/termcap.c | 12 +++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/usr/src/lib/libterm/Makefile b/usr/src/lib/libterm/Makefile index 477a3ccca7..60d8cd7877 100644 --- a/usr/src/lib/libterm/Makefile +++ b/usr/src/lib/libterm/Makefile @@ -14,7 +14,7 @@ # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # -# @(#)Makefile 5.6 (Berkeley) %G% +# @(#)Makefile 5.7 (Berkeley) %G% # CFLAGS= -O -DCM_N -DCM_GT -DCM_B -DCM_D LIBC= /lib/libc.a @@ -33,11 +33,14 @@ MDIR= ${DESTDIR}/usr/man/cat3 all: termcap.a termcap_p.a termcap.a termcap_p.a: ${OBJS} - ar cr termcap.a ${OBJS} - cd profiled; ar cr ../termcap_p.a ${OBJS} + @echo building normal termcap + @ar cr termcap.a ${OBJS} + ranlib termcap.a + @echo building profiled termcap + @cd profiled; ar cr ../termcap_p.a ${OBJS} + ranlib termcap_p.a test: - ranlib termcap.a ${CC} ${CFLAGS} -o tc1 tc1.c termcap.a ${CC} ${CFLAGS} -o tc2 tc2.c termcap.a ${CC} ${CFLAGS} -o tc3 tc3.c termcap.a @@ -53,13 +56,14 @@ depend: install: ${MAN} install -o bin -g bin -m 644 termcap.a ${DESTDIR}/usr/lib/libtermcap.a + ranlib -t ${DESTDIR}/usr/lib/libtermcap.a rm -f ${DESTDIR}/usr/lib/libtermlib.a ln ${DESTDIR}/usr/lib/libtermcap.a ${DESTDIR}/usr/lib/libtermlib.a - ranlib ${DESTDIR}/usr/lib/libtermcap.a - install -o bin -g bin -m 644 termcap_p.a ${DESTDIR}/usr/lib/libtermcap_p.a + install -o bin -g bin -m 644 termcap_p.a \ + ${DESTDIR}/usr/lib/libtermcap_p.a + ranlib -t ${DESTDIR}/urs/lib/libtermcap_p.a rm -f ${DESTDIR}/usr/lib/libtermlib_p.a ln ${DESTDIR}/usr/lib/libtermcap_p.a ${DESTDIR}/usr/lib/libtermlib_p.a - ranlib ${DESTDIR}/usr/lib/libtermcap_p.a install -c -o bin -g bin -m 444 termcap.0 ${DESTDIR}/usr/man/cat3 rm -f ${MDIR}/tgetent.0; ln ${MDIR}/termcap.0 ${MDIR}/tgetent.0 rm -f ${MDIR}/tgetflag.0; ln ${MDIR}/termcap.0 ${MDIR}/tgetflag.0 diff --git a/usr/src/lib/libterm/termcap.c b/usr/src/lib/libterm/termcap.c index b3ae0fe220..61e1d11547 100644 --- a/usr/src/lib/libterm/termcap.c +++ b/usr/src/lib/libterm/termcap.c @@ -16,16 +16,17 @@ */ #ifndef lint -static char sccsid[] = "@(#)termcap.c 5.3 (Berkeley) %G%"; +static char sccsid[] = "@(#)termcap.c 5.4 (Berkeley) %G%"; #endif /* not lint */ #define BUFSIZ 1024 #define MAXHOP 32 /* max number of tc= indirections */ #define PBUFSIZ 512 /* max length of filename path */ #define PVECSIZ 32 /* max number of names in path */ -#define DEF_PATH ".termcap /etc/termcap" #include +#include "pathnames.h" + /* * termcap - routines for dealing with the terminal capability data base * @@ -65,7 +66,6 @@ tgetent(bp, name) pvec = pathvec; tbuf = bp; p = pathbuf; -#ifndef V6 cp = getenv("TERMCAP"); /* * TERMCAP can have one of two things in it. It can be the @@ -86,14 +86,12 @@ tgetent(bp, name) strcpy(pathbuf, home); /* $HOME first */ *p++ = '/'; } /* if no $HOME look in current directory */ - strncpy(p, DEF_PATH, PBUFSIZ - (p - pathbuf)); + strncpy(p, _PATH_DEF, PBUFSIZ - (p - pathbuf)); } } else /* user-defined name in TERMCAP */ strncpy(pathbuf, cp, PBUFSIZ); /* still can be tokenized */ -#else - strncpy(pathbuf, "/etc/termcap", PBUFSIZ); -#endif + *fname++ = pathbuf; /* tokenize path into vector of names */ while (*++p) if (*p == ' ' || *p == ':') { -- 2.20.1