add rand, nargs
[unix-history] / usr / src / lib / libcurses / longname.c
CommitLineData
87c6fcf8 1/*
2f14f200
KB
2 * Copyright (c) 1981 Regents of the University of California.
3 * All rights reserved.
4 *
c07973a2 5 * %sccs.include.redist.c%
87c6fcf8
DF
6 */
7
8#ifndef lint
c07973a2 9static char sccsid[] = "@(#)longname.c 5.4 (Berkeley) %G%";
2f14f200 10#endif /* not lint */
87c6fcf8 11
b089ee09
KA
12# define reg register
13
14/*
15 * This routine fills in "def" with the long name of the terminal.
16 *
b089ee09
KA
17 */
18char *
19longname(bp, def)
20reg char *bp, *def; {
21
22 reg char *cp;
23
24 while (*bp && *bp != ':' && *bp != '|')
25 bp++;
26 if (*bp == '|') {
27 bp++;
62fc2477
JB
28 cp = def;
29 while (*bp && *bp != ':' && *bp != '|')
30 *cp++ = *bp++;
b089ee09 31 *cp = 0;
b089ee09
KA
32 }
33 return def;
34}