summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pppctl/pppctl.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-11-09 18:50:34 +0000
committerbrian <brian@FreeBSD.org>1997-11-09 18:50:34 +0000
commite1f7ff985c856b099d9dee943c37ce87a974f1de (patch)
treefb6ee2c5a8ec876e271e7e6f0fc3f31f97e617e2 /usr.sbin/pppctl/pppctl.c
parent0e30b185c2eaa1b0117f1b6de4934ade601e5644 (diff)
downloadFreeBSD-src-e1f7ff985c856b099d9dee943c37ce87a974f1de.zip
FreeBSD-src-e1f7ff985c856b099d9dee943c37ce87a974f1de.tar.gz
Prompt correctly when ppp *doesn't* ask for a password.
Diffstat (limited to 'usr.sbin/pppctl/pppctl.c')
-rw-r--r--usr.sbin/pppctl/pppctl.c5
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)) {
OpenPOWER on IntegriCloud