diff options
| author | Brian Somers <brian@FreeBSD.org> | 1998-06-15 19:06:58 +0000 |
|---|---|---|
| committer | Brian Somers <brian@FreeBSD.org> | 1998-06-15 19:06:58 +0000 |
| commit | d93d3a9c32d3e1ba843e8e7033f6570c714f86df (patch) | |
| tree | 688b48f8ca9968b60febe73fe13bf9be4db9b9d6 /usr.sbin/ppp/prompt.c | |
| parent | c9e11a112d47edb5544b4bbe115837c89329c798 (diff) | |
Notes
Diffstat (limited to 'usr.sbin/ppp/prompt.c')
| -rw-r--r-- | usr.sbin/ppp/prompt.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/ppp/prompt.c b/usr.sbin/ppp/prompt.c index bb10f4b3c1f7..98bcbe4e97f6 100644 --- a/usr.sbin/ppp/prompt.c +++ b/usr.sbin/ppp/prompt.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: prompt.c,v 1.3 1998/05/23 22:24:48 brian Exp $ + * $Id: prompt.c,v 1.4 1998/05/27 22:43:37 brian Exp $ */ #include <sys/param.h> @@ -72,6 +72,7 @@ static void prompt_Display(struct prompt *p) { + /* XXX: See Index2Nam() - should we only figure this out once ? */ static char shostname[MAXHOSTNAMELEN]; const char *pconnect, *pauth; @@ -170,7 +171,6 @@ prompt_Read(struct descriptor *d, struct bundle *bundle, const fd_set *fdset) struct prompt *p = descriptor2prompt(d); int n; char ch; - static int ttystate; char linebuff[LINE_LEN]; if (p->TermMode == NULL) { @@ -221,10 +221,10 @@ prompt_Read(struct descriptor *d, struct bundle *bundle, const fd_set *fdset) log_Printf(LogDEBUG, "Got %d bytes (reading from the terminal)\n", n); if (n > 0) { - switch (ttystate) { + switch (p->readtilde) { case 0: if (ch == '~') - ttystate++; + p->readtilde = 1; else if (physical_Write(p->TermMode->physical, &ch, n) < 0) { log_Printf(LogERROR, "error writing to modem: %s\n", strerror(errno)); @@ -259,7 +259,7 @@ prompt_Read(struct descriptor *d, struct bundle *bundle, const fd_set *fdset) } break; } - ttystate = 0; + p->readtilde = 0; break; } } @@ -311,6 +311,7 @@ prompt_Create(struct server *s, struct bundle *bundle, int fd) p->TermMode = NULL; p->nonewline = 1; p->needprompt = 1; + p->readtilde = 0; p->bundle = bundle; log_RegisterPrompt(p); } |
