xref: /original-bsd/lib/libcurses/fullname.c (revision 81f6297c)
1 # define	reg	register
2 
3 /*
4  *	This routine fills in "def" with the full name of the terminal.
5  * This is assumed to be the last name in the list of aliases.
6  *
7  * @(#)fullname.c	1.1 (Berkeley) 05/01/85
8  */
9 char *
10 fullname(bp, def)
11 reg char	*bp, *def;
12 {
13 
14 	reg char	*cp;
15 
16 	*def = 0;			/* in case no name */
17 
18 	while (*bp && *bp != ':') {
19 		cp = def;		/* start of answer */
20 		while (*bp && *bp != ':' && *bp != '|') {
21 			*cp++ = *bp++;	/* copy name over */
22 		}
23 		*cp = 0;		/* zero end of name */
24 		if (*bp == '|') {
25 			bp++;		/* skip over '|' if that is case */
26 		}
27 	}
28 	return(def);
29 }
30