From 9c8517c5731818d10b9c9074d68815eed4a2d659 Mon Sep 17 00:00:00 2001 From: cgd Date: Mon, 21 Jun 1999 02:31:17 +0000 Subject: [PATCH] handle CRs properly when running cmds w/output to subwin --- distrib/utils/sysinst/run.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/distrib/utils/sysinst/run.c b/distrib/utils/sysinst/run.c index 24e236bd64a7..5e52bb70e74f 100644 --- a/distrib/utils/sysinst/run.c +++ b/distrib/utils/sysinst/run.c @@ -1,4 +1,4 @@ -/* $NetBSD: run.c,v 1.17 1999/06/20 20:26:42 cgd Exp $ */ +/* $NetBSD: run.c,v 1.18 1999/06/21 02:31:17 cgd Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -353,21 +353,22 @@ launch_subwin(actionwin, args, win, display) (void)write(master, ibuf, n); for (j=0; j < n; j++) { if (display) { - if (ibuf[j] == '\n' || ibuf[j] == '\r') { - if (ibuf[j] == '\n') { - getyx(actionwin, ycor, xcor); - if (ycor + 1 >= actionwin->maxy) { - scroll(actionwin); - wmove(actionwin, actionwin->maxy - 1, 1); - } else - wmove(actionwin, ycor + 1, 1); - if (logging) - fprintf(log, "\n"); - } + getyx(actionwin, ycor, xcor); + if (ibuf[j] == '\n') { + if (ycor + 1 >= actionwin->maxy) { + scroll(actionwin); + wmove(actionwin, actionwin->maxy - 1, 1); + } else + wmove(actionwin, ycor + 1, 1); + if (logging) + fprintf(log, "\n"); + } else if (ibuf[j] == '\r') { + wmove(actionwin, ycor, 1); + if (logging) + fprintf(log, "\r"); } else { - getyx(actionwin, ycor, xcor); if (xcor == 0) - wmove(actionwin, ycor, xcor + 1); + wmove(actionwin, ycor, xcor + 1); waddch(actionwin, ibuf[j]); wrefresh(actionwin); if (logging) {