diff options
author | stark <stark@FreeBSD.org> | 1997-06-24 03:52:15 +0000 |
---|---|---|
committer | stark <stark@FreeBSD.org> | 1997-06-24 03:52:15 +0000 |
commit | 219e5197f27d044792bbf75a2b375ab3ee3a43aa (patch) | |
tree | a9a90e8d7bb06af84bd08b3bfa852c00dcd7e8be /libexec | |
parent | 0087bd0ef24a8e79782ab0baec2ab2942c1115bc (diff) | |
download | FreeBSD-src-219e5197f27d044792bbf75a2b375ab3ee3a43aa.zip FreeBSD-src-219e5197f27d044792bbf75a2b375ab3ee3a43aa.tar.gz |
Submitted by: Gene Stark and Robert Sexton (robert@kudra.com)
Added patches from Robert Sexton to eliminate case sensitivity of the
xtend command.
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/xtend/user.c | 23 | ||||
-rw-r--r-- | libexec/xtend/xtend.8 | 4 |
2 files changed, 17 insertions, 10 deletions
diff --git a/libexec/xtend/user.c b/libexec/xtend/user.c index a795dba..1a863af 100644 --- a/libexec/xtend/user.c +++ b/libexec/xtend/user.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: user.c,v 1.5 1997/02/22 14:22:42 peter Exp $ */ #include <stdio.h> @@ -47,20 +47,27 @@ MONENTRY Monitor[MAXMON]; user_command() { char h; + char *m; int i, k, c, n, error; char cmd[512], dumppath[MAXPATHLEN+1], pkt[3]; FILE *dumpf; error = 0; if(fgets(cmd, 512, User) != NULL) { + m = cmd; + while ( *m != '\0' ) { + if(isupper(*m)) + *m = tolower(*m); + m++; + } if(sscanf(cmd, "status %c %d", &h, &i) == 2 - && h >= 'A' && h <= 'P' && i >= 1 && i <= 16) { - h -= 'A'; + && h >= 'a' && h <= 'p' && i >= 1 && i <= 16) { + h -= 'a'; i--; printstatus(User, &Status[h][i]); } else if(sscanf(cmd, "send %c %s %d", &h, cmd, &n) == 3 - && h >= 'A' && h <= 'P' && (i = find(cmd, X10cmdnames)) >= 0) { - h -= 'A'; + && h >= 'a' && h <= 'p' && (i = find(cmd, X10cmdnames)) >= 0) { + h -= 'a'; pkt[0] = h; pkt[1] = i; pkt[2] = n; @@ -89,8 +96,8 @@ user_command() error++; } } else if(sscanf(cmd, "monitor %c %d", &h, &i) == 2 - && h >= 'A' && h <= 'P' && i >= 1 && i <= 16) { - h -= 'A'; + && h >= 'a' && h <= 'p' && i >= 1 && i <= 16) { + h -= 'a'; i--; for(k = 0; k < MAXMON; k++) { if(!Monitor[k].inuse) break; @@ -137,7 +144,7 @@ char *tab[]; int i; for(i = 0; tab[i] != NULL; i++) { - if(strcmp(s, tab[i]) == 0) return(i); + if(strcasecmp(s, tab[i]) == 0) return(i); } return(-1); } diff --git a/libexec/xtend/xtend.8 b/libexec/xtend/xtend.8 index afa1ecb..fe6209b 100644 --- a/libexec/xtend/xtend.8 +++ b/libexec/xtend/xtend.8 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id$ +.\" $Id: xtend.8,v 1.6 1997/02/22 14:22:43 peter Exp $ .\" .Th XTEND 8 "30 Oct 1993" .Dd Oct 30, 1993 @@ -160,7 +160,7 @@ pid file log file .It Pa /var/spool/xten/Status device status file (binary) -.It Pa /var/spool/xtend/status.out +.It Pa /var/spool/xten/status.out ASCII dump of device status .El .Sh BUGS |