xref: /original-bsd/lib/libcurses/longname.c (revision e59fb703)
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.4 (Berkeley) 06/01/90";
10 #endif /* not lint */
11 
12 # define	reg	register
13 
14 /*
15  *	This routine fills in "def" with the long name of the terminal.
16  *
17  */
18 char *
19 longname(bp, def)
20 reg char	*bp, *def; {
21 
22 	reg char	*cp;
23 
24 	while (*bp && *bp != ':' && *bp != '|')
25 		bp++;
26 	if (*bp == '|') {
27 		bp++;
28 		cp = def;
29 		while (*bp && *bp != ':' && *bp != '|')
30 			*cp++ = *bp++;
31 		*cp = 0;
32 	}
33 	return def;
34 }
35