Localize it (ctype)
8bit ctype clean fixes (I can't input 8bit chars otherwise in this new ftp, it beeps)
This commit is contained in:
parent
fa0913efdb
commit
943259e2fc
@ -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 @@ getit(argc, argv, restartit, mode)
|
||||
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 @@ domap(name)
|
||||
cp2++;
|
||||
}
|
||||
else if (*cp2 == '$' &&
|
||||
isdigit(*(cp2+1))) {
|
||||
isdigit((unsigned char)*(cp2+1))) {
|
||||
if (*++cp2 == '0') {
|
||||
char *cp3 = name;
|
||||
|
||||
@ -1833,7 +1833,7 @@ domap(name)
|
||||
}
|
||||
break;
|
||||
case '$':
|
||||
if (isdigit(*(cp2 + 1))) {
|
||||
if (isdigit((unsigned char)*(cp2 + 1))) {
|
||||
if (*++cp2 == '0') {
|
||||
char *cp3 = name;
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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 @@ domacro(argc, argv)
|
||||
*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--;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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 */
|
||||
|
@ -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':
|
||||
|
Loading…
Reference in New Issue
Block a user