summaryrefslogtreecommitdiffstats
path: root/usr.bin/sed
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1996-08-11 17:46:35 +0000
committerache <ache@FreeBSD.org>1996-08-11 17:46:35 +0000
commit4fbce9eec9b4b88334ffa6fef284a790009a3988 (patch)
treeac9ecdf1b0f419cdb30a88e73864fb571ab9a428 /usr.bin/sed
parent90489078d43eed0c1919d3bc06df618de9c65b52 (diff)
downloadFreeBSD-src-4fbce9eec9b4b88334ffa6fef284a790009a3988.zip
FreeBSD-src-4fbce9eec9b4b88334ffa6fef284a790009a3988.tar.gz
Localize it
8bit cleanup
Diffstat (limited to 'usr.bin/sed')
-rw-r--r--usr.bin/sed/compile.c4
-rw-r--r--usr.bin/sed/main.c4
-rw-r--r--usr.bin/sed/process.c4
3 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c
index c1bb8f9..91bf843 100644
--- a/usr.bin/sed/compile.c
+++ b/usr.bin/sed/compile.c
@@ -140,7 +140,7 @@ compile()
#define EATSPACE() do { \
if (p) \
- while (*p && isascii(*p) && isspace(*p)) \
+ while (*p && isspace((unsigned char)*p)) \
p++; \
} while (0)
@@ -696,7 +696,7 @@ duptoeol(s, ctype)
ws = 0;
for (start = s; *s != '\0' && *s != '\n'; ++s)
- ws = isspace(*s);
+ ws = isspace((unsigned char)*s);
*s = '\0';
if (ws)
err(WARNING, "whitespace after %s", ctype);
diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c
index 7a41bdb..dbea504 100644
--- a/usr.bin/sed/main.c
+++ b/usr.bin/sed/main.c
@@ -47,9 +47,9 @@ static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/3/94";
#include <sys/types.h>
-#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
+#include <locale.h>
#include <regex.h>
#include <stddef.h>
#include <stdio.h>
@@ -109,6 +109,8 @@ main(argc, argv)
{
int c, fflag;
+ (void) setlocale(LC_ALL, "");
+
fflag = 0;
while ((c = getopt(argc, argv, "ae:f:n")) != EOF)
switch (c) {
diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c
index c435e1e..3b0828c 100644
--- a/usr.bin/sed/process.c
+++ b/usr.bin/sed/process.c
@@ -475,7 +475,7 @@ lputs(s)
(void)printf("\\\n");
count = 0;
}
- if (isascii(*s) && isprint(*s) && *s != '\\') {
+ if (isprint((unsigned char)*s) && *s != '\\') {
(void)putchar(*s);
count++;
} else {
@@ -552,7 +552,7 @@ regsub(sp, string, src)
while ((c = *src++) != '\0') {
if (c == '&')
no = 0;
- else if (c == '\\' && isdigit(*src))
+ else if (c == '\\' && isdigit((unsigned char)*src))
no = *src++ - '0';
else
no = -1;
OpenPOWER on IntegriCloud