|
|
1.1 ! root 1: # define reg register ! 2: ! 3: /* ! 4: * This routine returns the long name of the terminal or "def" ! 5: * if none can be found. ! 6: * ! 7: * 5/15/81 (Berkeley) @(#)longname.c 1.2 ! 8: */ ! 9: char * ! 10: longname(bp, def) ! 11: reg char *bp, *def; { ! 12: ! 13: reg char *cp; ! 14: static char ttytype[20]; ! 15: char save; ! 16: ! 17: while (*bp && *bp != ':' && *bp != '|') ! 18: bp++; ! 19: if (*bp == '|') { ! 20: bp++; ! 21: cp = bp; ! 22: while (*cp && *cp != ':' && *cp != '|') ! 23: cp++; ! 24: save = *cp; ! 25: *cp = 0; ! 26: strcpy(ttytype, bp); ! 27: *cp = save; ! 28: return ttytype; ! 29: } ! 30: strcpy(ttytype, def); ! 31: return ttytype; ! 32: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.