summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/prompt.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-04-03 11:54:00 +0000
committerbrian <brian@FreeBSD.org>1999-04-03 11:54:00 +0000
commit5db8066ee9cdb955373c32193af6f95f65e204fb (patch)
treea9278079799020a63ed0219bfde87099a328fb4f /usr.sbin/ppp/prompt.c
parentaffd55a23b9e3a35ceccf2ae330484d3cd15000d (diff)
downloadFreeBSD-src-5db8066ee9cdb955373c32193af6f95f65e204fb.zip
FreeBSD-src-5db8066ee9cdb955373c32193af6f95f65e204fb.tar.gz
Handle the detection of frames even if we read them
with more than one read(). When we detect one, don't forget to pass it to async_Input() and drop our terminal back into command mode. Don't output an extraneous \r if we're passed \r\n to prompt_vprintf in raw mode.
Diffstat (limited to 'usr.sbin/ppp/prompt.c')
-rw-r--r--usr.sbin/ppp/prompt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ppp/prompt.c b/usr.sbin/ppp/prompt.c
index 7228a68..1cd5f7b 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.12 1998/08/26 17:39:37 brian Exp $
+ * $Id: prompt.c,v 1.13 1999/01/28 01:56:34 brian Exp $
*/
#include <sys/param.h>
@@ -380,7 +380,8 @@ prompt_vPrintf(struct prompt *p, const char *fmt, va_list ap)
/* Stuff '\r' in front of '\n' 'cos we're in raw mode */
int len = strlen(fmt);
- if (len && len < sizeof nfmt - 1 && fmt[len-1] == '\n') {
+ if (len && len < sizeof nfmt - 1 && fmt[len-1] == '\n' &&
+ (len == 1 || fmt[len-2] != '\r')) {
strcpy(nfmt, fmt);
strcpy(nfmt + len - 1, "\r\n");
pfmt = nfmt;
OpenPOWER on IntegriCloud