4BSD/usr/src/lib/libcurses/longname.c

Compare this file to the similar file:
Show the results in this format:

# define	reg	register

/*
 *	This routine fills in "def" with the long name of the terminal.
 */
char *
longname(bp, def)
reg char	*bp, *def; {

	reg char	*cp;

	while (*bp && *bp != ':' && *bp != '|')
		bp++;
	if (*bp == '|') {
		bp++;
		cp = bp;
		while (*cp && *cp != ':' && *cp != '|')
			cp++;
		*cp = 0;
		return bp;
	}
	return def;
}