home *** CD-ROM | disk | FTP | other *** search
- # define reg register
-
- /*
- * This routine fills in "def" with the long name of the terminal.
- *
- * 1/26/81 (Berkeley) @(#)longname.c 1.1
- *
- * 2/22/84 Corrections made at University of California, San Francisco.
- * This correction makes a private copy of the longname. The original version
- * simply patched a '\0' in the termcap buffer, preventing access to
- * terminal capabilities at a later point.
- * rti-sel!trt: note: this code is still broken wrt the documentation.
- * It operates confusingly and usually gets the wrong answer.
- */
-
- char *
- longname(bp, def)
- reg char *bp, *def; {
-
- reg char *cp;
- static char longcopy[30] ;
-
- while (*bp && *bp != ':' && *bp != '|')
- bp++;
- if (*bp == '|') {
- bp++;
- cp = longcopy ;
- while ((cp-longcopy)<29 && *bp && *bp != ':' && *bp != '|')
- *cp++ = *bp++ ;
- *cp = 0;
- return longcopy;
- }
- return def;
- }
-