summaryrefslogtreecommitdiffstats
path: root/usr.bin/fold
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2002-04-19 09:02:16 +0000
committerache <ache@FreeBSD.org>2002-04-19 09:02:16 +0000
commit19d3470c0329a4f70240fb7c64c118a1987829f0 (patch)
treef54812c398e0a26122bcd8f4782ed1f3fcb7d3d0 /usr.bin/fold
parent2074250b53996ca9d0f01af3173adb5dfc73c7b3 (diff)
downloadFreeBSD-src-19d3470c0329a4f70240fb7c64c118a1987829f0.zip
FreeBSD-src-19d3470c0329a4f70240fb7c64c118a1987829f0.tar.gz
Localize it, LC_CTYPE
Diffstat (limited to 'usr.bin/fold')
-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 68a3ebe..894e821 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;
}
OpenPOWER on IntegriCloud