* Copyright (c) 1983 Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* Edward Wang at The University of California, Berkeley.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)wwgets.c 3.16 (Berkeley) %G%";
while ((c
= wwgetc()) < 0)
if (c
== wwoldtty
.ww_sgttyb
.sg_erase
)
if (c
== wwoldtty
.ww_termios
.c_cc
[VERASE
])
if (c
== wwoldtty
.ww_sgttyb
.sg_kill
)
if (c
== wwoldtty
.ww_termios
.c_cc
[VKILL
])
if (c
== wwoldtty
.ww_ltchars
.t_werasc
)
if (c
== wwoldtty
.ww_termios
.c_cc
[VWERASE
])
while (--p
>= buf
&& (*p
== ' ' || *p
== '\t'))
while (p
>= buf
&& *p
!= ' ' && *p
!= '\t')
} else if (c
== '\r' || c
== '\n') {
wwputs(unctrl(*p
++ = c
), w
);
for (i
= strlen(unctrl(c
)); --i
>= 0;)
(void) wwwrite(w
, "\b \b", 3);