diff options
-rw-r--r-- | usr.bin/fold/fold.c | 5 |
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; } |