xref: /original-bsd/lib/libcurses/longname.c (revision d4dfefc4)
1 /*
2  * Copyright (c) 1981 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)longname.c	5.5 (Berkeley) 08/23/92";
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