diff options
| author | Gene Stark <stark@FreeBSD.org> | 1997-06-24 03:52:15 +0000 |
|---|---|---|
| committer | Gene Stark <stark@FreeBSD.org> | 1997-06-24 03:52:15 +0000 |
| commit | 8b9715c239d167cc026b483ae130b9993cd387c3 (patch) | |
| tree | e53f3dc63836147566452d6e2218baab00cd994b /libexec/xtend/user.c | |
| parent | 536f4d7cf31ef55b12224acc95764c76709a91d9 (diff) | |
Notes
Diffstat (limited to 'libexec/xtend/user.c')
| -rw-r--r-- | libexec/xtend/user.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/libexec/xtend/user.c b/libexec/xtend/user.c index a795dba1a3e6..1a863af6b054 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); } |
