diff options
author | Andrey A. Chernov <ache@FreeBSD.org> | 1997-06-27 09:30:15 +0000 |
---|---|---|
committer | Andrey A. Chernov <ache@FreeBSD.org> | 1997-06-27 09:30:15 +0000 |
commit | 943259e2fc47bb28d8c54ff3ffa7854f88b03c68 (patch) | |
tree | 5a1976d0dc0f828b83e34646c18bb6f9b59cc5fe /usr.bin/ftp | |
parent | fa0913efdb3ced837707eb25fc5dc3869535928e (diff) | |
download | src-943259e2fc47bb28d8c54ff3ffa7854f88b03c68.tar.gz src-943259e2fc47bb28d8c54ff3ffa7854f88b03c68.zip |
Localize it (ctype)
8bit ctype clean fixes
(I can't input 8bit chars otherwise in this new ftp, it beeps)
Notes
Notes:
svn path=/head/; revision=26977
Diffstat (limited to 'usr.bin/ftp')
-rw-r--r-- | usr.bin/ftp/cmds.c | 20 | ||||
-rw-r--r-- | usr.bin/ftp/complete.c | 6 | ||||
-rw-r--r-- | usr.bin/ftp/domacro.c | 10 | ||||
-rw-r--r-- | usr.bin/ftp/fetch.c | 8 | ||||
-rw-r--r-- | usr.bin/ftp/main.c | 7 | ||||
-rw-r--r-- | usr.bin/ftp/util.c | 6 |
6 files changed, 30 insertions, 27 deletions
diff --git a/usr.bin/ftp/cmds.c b/usr.bin/ftp/cmds.c index f083f95b901a..c3973ea491a0 100644 --- a/usr.bin/ftp/cmds.c +++ b/usr.bin/ftp/cmds.c @@ -1,4 +1,4 @@ -/* $Id$ */ +/* $Id: cmds.c,v 1.7 1997/06/25 08:56:34 msmith Exp $ */ /* $NetBSD: cmds.c,v 1.24 1997/05/17 19:44:36 pk Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)cmds.c 8.6 (Berkeley) 10/9/94"; #else -static char rcsid[] = "$Id$"; +static char rcsid[] = "$Id: cmds.c,v 1.7 1997/06/25 08:56:34 msmith Exp $"; #endif #endif /* not lint */ @@ -334,14 +334,14 @@ mput(argc, argv) if (mflag && confirm(argv[0], cp)) { tp = cp; if (mcase) { - while (*tp && !islower(*tp)) { + while (*tp && !islower((unsigned char)*tp)) { tp++; } if (!*tp) { tp = cp; tp2 = tmpbuf; while ((*tp2 = *tp) != '\0') { - if (isupper(*tp2)) { + if (isupper((unsigned char)*tp2)) { *tp2 = 'a' + *tp2 - 'A'; } tp++; @@ -477,14 +477,14 @@ usage: if (loc && mcase) { char *tp = argv[1], *tp2, tmpbuf[MAXPATHLEN]; - while (*tp && !islower(*tp)) { + while (*tp && !islower((unsigned char)*tp)) { tp++; } if (!*tp) { tp = argv[2]; tp2 = tmpbuf; while ((*tp2 = *tp) != '\0') { - if (isupper(*tp2)) { + if (isupper((unsigned char)*tp2)) { *tp2 = 'a' + *tp2 - 'A'; } tp++; @@ -583,7 +583,7 @@ mget(argc, argv) if (mflag && confirm(argv[0], cp)) { tp = cp; if (mcase) { - for (tp2 = tmpbuf; (ch = *tp++) != 0; ) + for (tp2 = tmpbuf; (ch = (unsigned char)*tp++) != 0; ) *tp2++ = isupper(ch) ? tolower(ch) : ch; *tp2 = '\0'; tp = tmpbuf; @@ -1754,7 +1754,7 @@ domap(name) break; case '[': LOOP: - if (*++cp2 == '$' && isdigit(*(cp2+1))) { + if (*++cp2 == '$' && isdigit((unsigned char)*(cp2+1))) { if (*++cp2 == '0') { char *cp3 = name; @@ -1779,7 +1779,7 @@ LOOP: cp2++; } else if (*cp2 == '$' && - isdigit(*(cp2+1))) { + isdigit((unsigned char)*(cp2+1))) { if (*++cp2 == '0') { char *cp3 = name; @@ -1833,7 +1833,7 @@ LOOP: } break; case '$': - if (isdigit(*(cp2 + 1))) { + if (isdigit((unsigned char)*(cp2 + 1))) { if (*++cp2 == '0') { char *cp3 = name; diff --git a/usr.bin/ftp/complete.c b/usr.bin/ftp/complete.c index e20c27c608c8..cb4e5fb3dcca 100644 --- a/usr.bin/ftp/complete.c +++ b/usr.bin/ftp/complete.c @@ -1,4 +1,4 @@ -/* $Id$ */ +/* $Id: complete.c,v 1.1 1997/06/25 08:56:36 msmith Exp $ */ /* $NetBSD: complete.c,v 1.8 1997/05/24 16:34:30 lukem Exp $ */ /*- @@ -39,7 +39,7 @@ #ifndef SMALL #ifndef lint -static char rcsid[] = "$Id$"; +static char rcsid[] = "$Id: complete.c,v 1.1 1997/06/25 08:56:36 msmith Exp $"; #endif /* not lint */ /* @@ -337,7 +337,7 @@ complete(el, ch) /* check for 'continuation' completes (which are uppercase) */ if ((cursor_argc > celems) && (celems > 0) - && isupper(c->c_complete[celems-1])) + && isupper((unsigned char)c->c_complete[celems-1])) cursor_argc = celems; if (cursor_argc > celems) diff --git a/usr.bin/ftp/domacro.c b/usr.bin/ftp/domacro.c index cb42f7ed6e34..3c058ca1e501 100644 --- a/usr.bin/ftp/domacro.c +++ b/usr.bin/ftp/domacro.c @@ -1,4 +1,4 @@ -/* $Id$ */ +/* $Id: domacro.c,v 1.2 1997/06/25 08:56:37 msmith Exp $ */ /* $NetBSD: domacro.c,v 1.9 1997/03/13 06:23:14 lukem Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)domacro.c 8.3 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$Id$"; +static char rcsid[] = "$Id: domacro.c,v 1.2 1997/06/25 08:56:37 msmith Exp $"; #endif #endif /* not lint */ @@ -77,7 +77,7 @@ domacro(argc, argv) TOP: cp1 = macros[i].mac_start; while (cp1 != macros[i].mac_end) { - while (isspace(*cp1)) { + while (isspace((unsigned char)*cp1)) { cp1++; } cp2 = line; @@ -87,9 +87,9 @@ TOP: *cp2++ = *++cp1; break; case '$': - if (isdigit(*(cp1+1))) { + if (isdigit((unsigned char)*(cp1+1))) { j = 0; - while (isdigit(*++cp1)) { + while (isdigit((unsigned char)*++cp1)) { j = 10*j + *cp1 - '0'; } cp1--; diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c index 5774e775c141..e79c0a76c4aa 100644 --- a/usr.bin/ftp/fetch.c +++ b/usr.bin/ftp/fetch.c @@ -1,4 +1,4 @@ -/* $Id$ */ +/* $Id: fetch.c,v 1.1 1997/06/25 08:56:39 msmith Exp $ */ /* $NetBSD: fetch.c,v 1.10 1997/05/23 18:54:18 lukem Exp $ */ /*- @@ -38,7 +38,7 @@ */ #ifndef lint -static char rcsid[] = "$Id$"; +static char rcsid[] = "$Id: fetch.c,v 1.1 1997/06/25 08:56:39 msmith Exp $"; #endif /* not lint */ /* @@ -162,7 +162,7 @@ url_get(origline, proxyenv) memset(&sin, 0, sizeof(sin)); sin.sin_family = AF_INET; - if (isdigit(host[0])) { + if (isdigit((unsigned char)host[0])) { if (inet_aton(host, &sin.sin_addr) == 0) { warnx("Invalid IP address: %s", host); goto cleanup_url_get; @@ -260,7 +260,7 @@ url_get(origline, proxyenv) */ #define CONTENTLEN "Content-Length: " for (cp = buf; *cp != '\0'; cp++) { - if (tolower(*cp) == 'c' && + if (tolower((unsigned char)*cp) == 'c' && strncasecmp(cp, CONTENTLEN, sizeof(CONTENTLEN) - 1) == 0) break; } diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c index 1705021d8eaa..a7f2e5697ead 100644 --- a/usr.bin/ftp/main.c +++ b/usr.bin/ftp/main.c @@ -1,4 +1,4 @@ -/* $Id$ */ +/* $Id: main.c,v 1.13 1997/06/25 08:56:42 msmith Exp $ */ /* $NetBSD: main.c,v 1.22 1997/06/10 07:04:43 lukem Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94"; #else -static char rcsid[] = "$Id$"; +static char rcsid[] = "$Id: main.c,v 1.13 1997/06/25 08:56:42 msmith Exp $"; #endif #endif /* not lint */ @@ -55,6 +55,7 @@ static char rcsid[] = "$Id$"; #include <sys/socket.h> #include <err.h> +#include <locale.h> #include <netdb.h> #include <pwd.h> #include <stdio.h> @@ -75,6 +76,8 @@ main(argc, argv) char *cp, homedir[MAXPATHLEN]; int dumbterm; + (void) setlocale(LC_CTYPE, ""); + sp = getservbyname("ftp", "tcp"); if (sp == 0) ftpport = htons(FTP_PORT); /* good fallback */ diff --git a/usr.bin/ftp/util.c b/usr.bin/ftp/util.c index 43c9c3834325..30b48c70119c 100644 --- a/usr.bin/ftp/util.c +++ b/usr.bin/ftp/util.c @@ -1,4 +1,4 @@ -/* $Id$ */ +/* $Id: util.c,v 1.1 1997/06/25 08:56:46 msmith Exp $ */ /* $NetBSD: util.c,v 1.9 1997/06/10 22:00:01 lukem Exp $ */ /* @@ -35,7 +35,7 @@ */ #ifndef lint -static char rcsid[] = "$Id$"; +static char rcsid[] = "$Id: util.c,v 1.1 1997/06/25 08:56:46 msmith Exp $"; #endif /* not lint */ /* @@ -389,7 +389,7 @@ confirm(cmd, file) (void)fflush(stdout); if (fgets(line, sizeof(line), stdin) == NULL) return (0); - switch (tolower(*line)) { + switch (tolower((unsigned char)*line)) { case 'n': return (0); case 'p': |