add mpool
[unix-history] / usr / src / lib / libcurses / fullname.c
CommitLineData
6e1c93d0 1/*
2f14f200
KB
2 * Copyright (c) 1981 Regents of the University of California.
3 * All rights reserved.
4 *
c07973a2 5 * %sccs.include.redist.c%
6e1c93d0
DF
6 */
7
8#ifndef lint
c07973a2 9static char sccsid[] = "@(#)fullname.c 5.4 (Berkeley) %G%";
2f14f200 10#endif /* not lint */
6e1c93d0 11
377b937d
JB
12# define reg register
13
14/*
15 * This routine fills in "def" with the full name of the terminal.
16 * This is assumed to be the last name in the list of aliases.
17 *
377b937d
JB
18 */
19char *
20fullname(bp, def)
21reg char *bp, *def;
22{
23
24 reg char *cp;
25
26 *def = 0; /* in case no name */
27
28 while (*bp && *bp != ':') {
29 cp = def; /* start of answer */
30 while (*bp && *bp != ':' && *bp != '|') {
31 *cp++ = *bp++; /* copy name over */
32 }
33 *cp = 0; /* zero end of name */
34 if (*bp == '|') {
35 bp++; /* skip over '|' if that is case */
36 }
37 }
38 return(def);
39}