Source-Changes-HG archive

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

[src/netbsd-1-4]: src/usr.bin/systat Pull up revision 1.6 (requested by he):



details:   https://anonhg.NetBSD.org/src/rev/5a9c5b684fa1
branches:  netbsd-1-4
changeset: 469502:5a9c5b684fa1
user:      he <he%NetBSD.org@localhost>
date:      Sun Sep 26 13:39:26 1999 +0000

description:
Pull up revision 1.6 (requested by he):
  Do not downcase input, which prevented "ignore X11" in the
  "netstat" display from working.  Fixes PR#7655.

diffstat:

 usr.bin/systat/keyboard.c |  19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diffs (60 lines):

diff -r 337152dad5b2 -r 5a9c5b684fa1 usr.bin/systat/keyboard.c
--- a/usr.bin/systat/keyboard.c Sun Sep 26 13:38:54 1999 +0000
+++ b/usr.bin/systat/keyboard.c Sun Sep 26 13:39:26 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: keyboard.c,v 1.5 1998/07/12 05:59:00 mrg Exp $ */
+/*     $NetBSD: keyboard.c,v 1.5.2.1 1999/09/26 13:39:26 he Exp $      */
 
 /*-
  * Copyright (c) 1980, 1992, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)keyboard.c 8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: keyboard.c,v 1.5 1998/07/12 05:59:00 mrg Exp $");
+__RCSID("$NetBSD: keyboard.c,v 1.5.2.1 1999/09/26 13:39:26 he Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -55,8 +55,8 @@
 int
 keyboard()
 {
-       char ch, *line;
-       int linesz;
+       char ch, rch, *line;
+       int i, linesz;
        sigset_t set;
 
        sigemptyset(&set);
@@ -79,6 +79,7 @@
                                clearerr(stdin);
                                continue;
                        }
+                       rch = ch;
                        if (ch >= 'A' && ch <= 'Z')
                                ch += 'a' - 'A';
                        if (col == 0) {
@@ -124,15 +125,19 @@
                                clrtoeol();
                                continue;
                        }
-                       if (isprint(ch) || ch == ' ') {
+                       if (isprint(rch) || ch == ' ') {
                                if (col < linesz) {
-                                       line[col] = ch;
-                                       mvaddch(CMDLINE, col, ch);
+                                       line[col] = rch;
+                                       mvaddch(CMDLINE, col, rch);
                                        col++;
                                }
                        }
                } while (col == 0 || (ch != '\r' && ch != '\n'));
                line[col] = '\0';
+               /* pass commands as lowercase */
+               for (i = 1; i < col && line[i] != ' '; i++)
+                   if (line[i] >= 'A' && line[i] <= 'Z')
+                       line[i] += 'a' - 'A';
                sigprocmask(SIG_BLOCK, &set, NULL);
                command(line + 1);
                sigprocmask(SIG_UNBLOCK, &set, NULL);



Home | Main Index | Thread Index | Old Index