summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1997-06-27 09:30:15 +0000
committerache <ache@FreeBSD.org>1997-06-27 09:30:15 +0000
commitfae8900137945449327d19f5b8d519086f5a6033 (patch)
tree6b4f5813e991617051d4890b73f6b95d008a5772 /usr.bin
parent6d60ffd86ab763b4c8b04ee0a43cf1c9fa7be893 (diff)
downloadFreeBSD-src-fae8900137945449327d19f5b8d519086f5a6033.zip
FreeBSD-src-fae8900137945449327d19f5b8d519086f5a6033.tar.gz
Localize it (ctype)
8bit ctype clean fixes (I can't input 8bit chars otherwise in this new ftp, it beeps)
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ftp/cmds.c20
-rw-r--r--usr.bin/ftp/complete.c6
-rw-r--r--usr.bin/ftp/domacro.c10
-rw-r--r--usr.bin/ftp/fetch.c8
-rw-r--r--usr.bin/ftp/main.c7
-rw-r--r--usr.bin/ftp/util.c6
6 files changed, 30 insertions, 27 deletions
diff --git a/usr.bin/ftp/cmds.c b/usr.bin/ftp/cmds.c
index f083f95..c3973ea 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 e20c27c..cb4e5fb 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 cb42f7e..3c058ca 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 5774e77..e79c0a7 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 1705021..a7f2e56 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 43c9c38..30b48c7 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':
OpenPOWER on IntegriCloud