xref: /original-bsd/lib/libcurses/longname.c (revision c3e32dec)
1 /*
2  * Copyright (c) 1981, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)longname.c	8.1 (Berkeley) 06/04/93";
10 #endif	/* not lint */
11 
12 /*
13  * longname --
14  *	Fill in "def" with the long name of the terminal.
15  */
16 char *
17 longname(bp, def)
18 	register char *bp, *def;
19 {
20 	register char *cp;
21 
22 	while (*bp && *bp != ':' && *bp != '|')
23 		bp++;
24 	if (*bp == '|') {
25 		for (cp = def, ++bp; *bp && *bp != ':' && *bp != '|';)
26 			*cp++ = *bp++;
27 		*cp = '\0';
28 	}
29 	return (def);
30 }
31