diff options
author | brian <brian@FreeBSD.org> | 1997-11-09 18:50:34 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-11-09 18:50:34 +0000 |
commit | e1f7ff985c856b099d9dee943c37ce87a974f1de (patch) | |
tree | fb6ee2c5a8ec876e271e7e6f0fc3f31f97e617e2 /usr.sbin | |
parent | 0e30b185c2eaa1b0117f1b6de4934ade601e5644 (diff) | |
download | FreeBSD-src-e1f7ff985c856b099d9dee943c37ce87a974f1de.zip FreeBSD-src-e1f7ff985c856b099d9dee943c37ce87a974f1de.tar.gz |
Prompt correctly when ppp *doesn't* ask for a password.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pppctl/pppctl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/pppctl/pppctl.c b/usr.sbin/pppctl/pppctl.c index 809becc..ea5b115 100644 --- a/usr.sbin/pppctl/pppctl.c +++ b/usr.sbin/pppctl/pppctl.c @@ -79,17 +79,18 @@ Receive(int fd, unsigned TimeoutVal, int display) Result = -1; break; } else if (len > 2 && !strcmp(Buffer+len-2, "> ")) { + prompt = strrchr(Buffer, '\n'); if (display & (REC_SHOW|REC_VERBOSE)) { if (display & REC_VERBOSE) last = Buffer+len-1; else - last = strrchr(Buffer, '\n'); + last = prompt; if (last) { last++; write(1, Buffer, last-Buffer); - prompt = last; } } + prompt = prompt == NULL ? Buffer : prompt+1; for (last = Buffer+len-2; last > Buffer && *last != ' '; last--) ; if (last > Buffer+3 && !strncmp(last-3, " on", 3)) { |