summaryrefslogtreecommitdiff
path: root/usr.bin/less
diff options
context:
space:
mode:
authordsl <dsl@NetBSD.org>2004-10-30 20:17:19 +0000
committerdsl <dsl@NetBSD.org>2004-10-30 20:17:19 +0000
commit5355c8187920b6186533df80fdffc4c77637a545 (patch)
tree7851accf2eb717068e11ceec3744c305a1a861f8 /usr.bin/less
parent7c1ffafac22c3ff3dc229df5c77db959a501b865 (diff)
Add (unsigned char) cast to ctype functions
Diffstat (limited to 'usr.bin/less')
-rw-r--r--usr.bin/less/less/command.c12
-rw-r--r--usr.bin/less/less/opttbl.c4
-rw-r--r--usr.bin/less/less/tags.c20
3 files changed, 18 insertions, 18 deletions
diff --git a/usr.bin/less/less/command.c b/usr.bin/less/less/command.c
index ab05277ccca..4246e166d8e 100644
--- a/usr.bin/less/less/command.c
+++ b/usr.bin/less/less/command.c
@@ -1,4 +1,4 @@
-/* $NetBSD: command.c,v 1.10 2003/04/14 02:56:46 mrg Exp $ */
+/* $NetBSD: command.c,v 1.11 2004/10/30 20:17:19 dsl Exp $ */
/*
* Copyright (C) 1984-2002 Mark Nudelman
@@ -416,7 +416,7 @@ mca_char(c)
if (cmd_char(c) == CC_QUIT)
return (MCA_DONE);
p = get_cmdbuf();
- lc = islower(p[0]);
+ lc = islower((unsigned char)p[0]);
o = findopt_name(&p, &oname, NULL);
if (o != NULL)
{
@@ -426,14 +426,14 @@ mca_char(c)
* display the full option name.
*/
optchar = o->oletter;
- if (!lc && islower(optchar))
- optchar = toupper(optchar);
+ if (!lc)
+ optchar = toupper((unsigned char)optchar);
cmd_reset();
mca_opt_toggle();
for (p = oname; *p != '\0'; p++)
{
- c = *p;
- if (!lc && islower(c))
+ c = (unsigned char)*p;
+ if (!lc)
c = toupper(c);
if (cmd_char(c) != CC_OK)
return (MCA_DONE);
diff --git a/usr.bin/less/less/opttbl.c b/usr.bin/less/less/opttbl.c
index 27a2e9344cc..19a80a88299 100644
--- a/usr.bin/less/less/opttbl.c
+++ b/usr.bin/less/less/opttbl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: opttbl.c,v 1.10 2003/04/14 03:02:29 mrg Exp $ */
+/* $NetBSD: opttbl.c,v 1.11 2004/10/30 20:17:19 dsl Exp $ */
/*
* Copyright (C) 1984-2002 Mark Nudelman
@@ -465,7 +465,7 @@ findopt(c)
{
if (o->oletter == c)
return (o);
- if ((o->otype & TRIPLE) && toupper(o->oletter) == c)
+ if ((o->otype & TRIPLE) && toupper((unsigned char)o->oletter) == c)
return (o);
}
return (NULL);
diff --git a/usr.bin/less/less/tags.c b/usr.bin/less/less/tags.c
index 93c3eb9c98a..2d5f9b0f130 100644
--- a/usr.bin/less/less/tags.c
+++ b/usr.bin/less/less/tags.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tags.c,v 1.5 2003/11/17 11:16:10 wiz Exp $ */
+/* $NetBSD: tags.c,v 1.6 2004/10/30 20:17:19 dsl Exp $ */
/*
* Copyright (C) 1984-2002 Mark Nudelman
@@ -714,12 +714,12 @@ getentry(buf, tag, file, line)
{
char *p = buf;
- for (*tag = p; *p && !isspace(*p); p++) /* tag name */
+ for (*tag = p; *p && !isspace((unsigned char)*p); p++) /* tag name */
;
if (*p == 0)
return (-1);
*p++ = 0;
- for ( ; *p && isspace(*p); p++) /* (skip blanks) */
+ for ( ; *p && isspace((unsigned char)*p); p++) /* (skip blanks) */
;
if (*p == 0)
return (-1);
@@ -727,27 +727,27 @@ getentry(buf, tag, file, line)
* If the second part begin with other than digit,
* it is assumed tag type. Skip it.
*/
- if (!isdigit(*p))
+ if (!isdigit((unsigned char)*p))
{
- for ( ; *p && !isspace(*p); p++) /* (skip tag type) */
+ for ( ; *p && !isspace((unsigned char)*p); p++) /* (skip tag type) */
;
- for (; *p && isspace(*p); p++) /* (skip blanks) */
+ for (; *p && isspace((unsigned char)*p); p++) /* (skip blanks) */
;
}
- if (!isdigit(*p))
+ if (!isdigit((unsigned char)*p))
return (-1);
*line = p; /* line number */
- for (*line = p; *p && !isspace(*p); p++)
+ for (*line = p; *p && !isspace((unsigned char)*p); p++)
;
if (*p == 0)
return (-1);
*p++ = 0;
- for ( ; *p && isspace(*p); p++) /* (skip blanks) */
+ for ( ; *p && isspace((unsigned char)*p); p++) /* (skip blanks) */
;
if (*p == 0)
return (-1);
*file = p; /* file name */
- for (*file = p; *p && !isspace(*p); p++)
+ for (*file = p; *p && !isspace((unsigned char)*p); p++)
;
if (*p == 0)
return (-1);