diff options
author | brian <brian@FreeBSD.org> | 1997-05-08 01:26:31 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-05-08 01:26:31 +0000 |
commit | 049664f16aada6df62fa06234d7e279afe2ea791 (patch) | |
tree | b7497b84d38052c6a6198498f4d90ce96a27f952 /usr.sbin/ppp | |
parent | 6cbcb88eb891aff59966e4317e1dc42874b20ad4 (diff) | |
download | FreeBSD-src-049664f16aada6df62fa06234d7e279afe2ea791.zip FreeBSD-src-049664f16aada6df62fa06234d7e279afe2ea791.tar.gz |
Allow mixed case commands.
Allow HISADDR, MYADDR, INTERFACE and ALL in mixed case.
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r-- | usr.sbin/ppp/command.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c index f861f4fc..b0497c0 100644 --- a/usr.sbin/ppp/command.c +++ b/usr.sbin/ppp/command.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: command.c,v 1.39 1997/04/21 01:01:40 brian Exp $ + * $Id: command.c,v 1.40 1997/05/07 23:01:25 brian Exp $ * */ #include <sys/types.h> @@ -78,7 +78,7 @@ struct cmdtab *plist; if (argc > 0) { for (cmd = plist; cmd->name; cmd++) { - if (strcmp(cmd->name, *argv) == 0 && (cmd->lauth & VarLocalAuth)) { + if (strcasecmp(cmd->name, *argv) == 0 && (cmd->lauth & VarLocalAuth)) { if (plist == SetCommands) printf("set "); printf("%s %s\n", cmd->name, cmd->syntax); @@ -213,13 +213,13 @@ char **argv; if(argc > 0) { /* substitute pseudo args */ for (i=1; i<argc; i++) { - if (strcmp(argv[i], "HISADDR") == 0) { + if (strcasecmp(argv[i], "HISADDR") == 0) { argv[i] = strdup(inet_ntoa(IpcpInfo.his_ipaddr)); } - if (strcmp(argv[i], "INTERFACE") == 0) { + if (strcasecmp(argv[i], "INTERFACE") == 0) { argv[i] = strdup(IfDevName); } - if (strcmp(argv[i], "MYADDR") == 0) { + if (strcasecmp(argv[i], "MYADDR") == 0) { argv[i] = strdup(inet_ntoa(IpcpInfo.want_ipaddr)); } } @@ -478,10 +478,10 @@ int *pmatch; struct cmdtab *found = NULL; while (cmds->func) { - if (cmds->name && strncmp(str, cmds->name, len) == 0) { + if (cmds->name && strncasecmp(str, cmds->name, len) == 0) { nmatch++; found = cmds; - } else if (cmds->alias && strncmp(str, cmds->alias, len) == 0) { + } else if (cmds->alias && strncasecmp(str, cmds->alias, len) == 0) { nmatch++; found = cmds; } @@ -1147,7 +1147,7 @@ char **argv; if (argc == 3) { dest = GetIpAddr(argv[0]); netmask = GetIpAddr(argv[1]); - if (strcmp(argv[2], "HISADDR") == 0) + if (strcasecmp(argv[2], "HISADDR") == 0) gateway = IpcpInfo.his_ipaddr; else gateway = GetIpAddr(argv[2]); @@ -1168,7 +1168,7 @@ char **argv; if (argc >= 2) { dest = GetIpAddr(argv[0]); - if (strcmp(argv[1], "HISADDR") == 0) + if (strcasecmp(argv[1], "HISADDR") == 0) gateway = IpcpInfo.his_ipaddr; else gateway = GetIpAddr(argv[1]); @@ -1180,7 +1180,7 @@ char **argv; } } OsSetRoute(RTM_DELETE, dest, gateway, netmask); - } else if (argc == 1 && strcmp(argv[0], "ALL") == 0) { + } else if (argc == 1 && strcasecmp(argv[0], "ALL") == 0) { DeleteIfRoutes(0); } else { printf("Usage: %s %s\n", list->name, list->syntax); |