Commit | Line | Data |
---|---|---|
6e1c93d0 | 1 | /* |
2f14f200 KB |
2 | * Copyright (c) 1981 Regents of the University of California. |
3 | * All rights reserved. | |
4 | * | |
c07973a2 | 5 | * %sccs.include.redist.c% |
6e1c93d0 DF |
6 | */ |
7 | ||
8 | #ifndef lint | |
1e126f74 | 9 | static char sccsid[] = "@(#)fullname.c 5.5 (Berkeley) %G%"; |
51f945cc | 10 | #endif /* not lint */ |
377b937d JB |
11 | |
12 | /* | |
51f945cc | 13 | * fullname -- |
377b937d | 14 | * This routine fills in "def" with the full name of the terminal. |
51f945cc | 15 | * This is assumed to be the last name in the list of aliases. |
377b937d JB |
16 | */ |
17 | char * | |
18 | fullname(bp, def) | |
51f945cc | 19 | register char *bp, *def; |
377b937d | 20 | { |
51f945cc | 21 | register char *cp; |
377b937d | 22 | |
51f945cc | 23 | *def = '\0'; /* In case no name. */ |
377b937d JB |
24 | |
25 | while (*bp && *bp != ':') { | |
51f945cc KB |
26 | cp = def; /* Start of answer. */ |
27 | while (*bp && *bp != ':' && *bp != '|') | |
28 | *cp++ = *bp++; /* Copy name over. */ | |
29 | *cp = '\0'; /* Zero end of name. */ | |
30 | if (*bp == '|') | |
31 | bp++; /* Skip over '|' if that is case. */ | |
377b937d | 32 | } |
51f945cc | 33 | return (def); |
377b937d | 34 | } |