case CTRL('r'): while (pe > buf)
case CTRL('u'): while (pe-- > buf)
readline(buf, to)	register char *buf;	int	to;{	register char *p = buf, *pe = buf, ch;	time_t tt;	for (tt = getsecs() + to; getsecs() < tt && !cnischar(); )		;	if (!cnischar())		return 0;	while (1) {		switch ((ch = getchar())) {		case CTRL('r'):			while (pe > buf)				putchar('\177');			printf(buf);		case CTRL('u'):			while (pe >= buf) {				pe--;				putchar('\177');			}			p = pe = buf;			continue;		case '\n':		case '\r':			pe[1] = *pe = '\0';			break;		case '\b':		case '\177':			if (p > buf) {				putchar('\177');				p--;				pe--;			}			continue;		default:			pe++;			*p++ = ch;			continue;		}		break;	}	return pe - buf;}