diff options
Diffstat (limited to 'usr.bin/wc/wc.c')
-rw-r--r-- | usr.bin/wc/wc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/wc/wc.c b/usr.bin/wc/wc.c index a50196c..1f1c9b3 100644 --- a/usr.bin/wc/wc.c +++ b/usr.bin/wc/wc.c @@ -44,6 +44,7 @@ static char sccsid[] = "@(#)wc.c 8.1 (Berkeley) 6/6/93"; #include <sys/param.h> #include <sys/stat.h> #include <fcntl.h> +#include <locale.h> #include <unistd.h> #include <errno.h> #include <stdio.h> @@ -66,6 +67,8 @@ main(argc, argv) register int ch; int total; + (void) setlocale(LC_CTYPE, ""); + while ((ch = getopt(argc, argv, "lwc")) != EOF) switch((char)ch) { case 'l': @@ -115,9 +118,9 @@ void cnt(file) char *file; { - register u_char *p; + register u_char *p, ch; register short gotsp; - register int ch, len; + register int len; register u_long linect, wordct, charct; struct stat sb; int fd; |