aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2002-04-19 09:02:16 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2002-04-19 09:02:16 +0000
commita243305fbe9b0870386544a36f4d65f0f7e943f7 (patch)
treef54812c398e0a26122bcd8f4782ed1f3fcb7d3d0 /usr.bin
parent60f514a9a79cb66c0bb9ea1257c66f2ce4882c11 (diff)
downloadsrc-a243305fbe9b0870386544a36f4d65f0f7e943f7.tar.gz
src-a243305fbe9b0870386544a36f4d65f0f7e943f7.zip
Localize it, LC_CTYPE
Notes
Notes: svn path=/head/; revision=95033
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/fold/fold.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/fold/fold.c b/usr.bin/fold/fold.c
index 68a3ebed5fb4..894e82196cdb 100644
--- a/usr.bin/fold/fold.c
+++ b/usr.bin/fold/fold.c
@@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");
#include <ctype.h>
#include <err.h>
#include <limits.h>
+#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -75,6 +76,8 @@ main(argc, argv)
int width;
char *p;
+ (void) setlocale(LC_CTYPE, "");
+
width = -1;
while ((ch = getopt(argc, argv, "0123456789bsw:")) != -1)
switch (ch) {
@@ -155,7 +158,7 @@ fold(width)
if ((col = newpos(col, ch)) > width) {
if (sflag) {
i = indx;
- while (--i >= 0 && !isblank(buf[i]))
+ while (--i >= 0 && !isblank((unsigned char)buf[i]))
;
space = i;
}