Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib/utils/sysinst simplify the code to display cmd outpu...



details:   https://anonhg.NetBSD.org/src/rev/f6c84812c498
branches:  trunk
changeset: 473903:f6c84812c498
user:      cgd <cgd%NetBSD.org@localhost>
date:      Mon Jun 21 02:47:41 1999 +0000

description:
simplify the code to display cmd output in subwindows slightly.  while
at it, remove the gratuitous inefficiencies.

diffstat:

 distrib/utils/sysinst/run.c |  33 ++++++++++++---------------------
 1 files changed, 12 insertions(+), 21 deletions(-)

diffs (54 lines):

diff -r 1c55f3f20bec -r f6c84812c498 distrib/utils/sysinst/run.c
--- a/distrib/utils/sysinst/run.c       Mon Jun 21 02:32:20 1999 +0000
+++ b/distrib/utils/sysinst/run.c       Mon Jun 21 02:47:41 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: run.c,v 1.18 1999/06/21 02:31:17 cgd Exp $     */
+/*     $NetBSD: run.c,v 1.19 1999/06/21 02:47:41 cgd Exp $     */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -355,33 +355,24 @@
                                        if (display) {
                                                getyx(actionwin, ycor, xcor);
                                                if (ibuf[j] == '\n') {
+                                                       getyx(actionwin, ycor, xcor);
                                                        if (ycor + 1 >= actionwin->maxy) {
                                                                scroll(actionwin);
-                                                               wmove(actionwin, actionwin->maxy - 1, 1);
+                                                               wmove(actionwin, actionwin->maxy - 1, 0);
                                                        } else
-                                                               wmove(actionwin, ycor + 1, 1);
-                                                       if (logging)
-                                                               fprintf(log, "\n");
+                                                               wmove(actionwin, ycor + 1, 0);
                                                } else if (ibuf[j] == '\r') {
-                                                       wmove(actionwin, ycor, 1);
-                                                       if (logging)
-                                                               fprintf(log, "\r");
-                                               } else {
-                                                       if (xcor == 0)
-                                                               wmove(actionwin, ycor, xcor + 1);
+                                                       getyx(actionwin, ycor, xcor);
+                                                       wmove(actionwin, ycor, 0);
+                                               } else
                                                        waddch(actionwin, ibuf[j]);
-                                                       wrefresh(actionwin);
-                                                       if (logging) {
-                                                               putc(ibuf[j], log);
-                                                               fflush(log);
-                                                       }
-                                               }
-                                       } else {  /* display is off */
-                                               if (logging) {
+                                               if (logging)
                                                        putc(ibuf[j], log);
-                                                       fflush(log);
-                                               }
                                        }
+                                       if (display)
+                                               wrefresh(actionwin);
+                                       if (logging)
+                                               fflush(log);
                                }
                        }
                }



Home | Main Index | Thread Index | Old Index