summaryrefslogtreecommitdiffstats
path: root/usr.bin/wc
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-08-11 10:52:13 +0000
committertjr <tjr@FreeBSD.org>2002-08-11 10:52:13 +0000
commit40eb0ec9c329b12eaedb472b11a009c55c87b84a (patch)
tree0c7c1eb0106b14df80720734ace305fbf6cc2c92 /usr.bin/wc
parent9e94669b318caf0f97ff31f3c8fe7deb5dfd3c1b (diff)
downloadFreeBSD-src-40eb0ec9c329b12eaedb472b11a009c55c87b84a.zip
FreeBSD-src-40eb0ec9c329b12eaedb472b11a009c55c87b84a.tar.gz
Use the iswspace(3) function now that it's been implemented.
Diffstat (limited to 'usr.bin/wc')
-rw-r--r--usr.bin/wc/wc.16
-rw-r--r--usr.bin/wc/wc.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/wc/wc.1 b/usr.bin/wc/wc.1
index 6d2ec64..80afcda 100644
--- a/usr.bin/wc/wc.1
+++ b/usr.bin/wc/wc.1
@@ -57,7 +57,7 @@ character,
and a word is defined as a string of characters delimited by white space
characters.
White space characters are the set of characters for which the
-.Xr isspace 3
+.Xr iswspace 3
function returns true.
If more than one input file is specified, a line of cumulative counts
for all the files is displayed on a separate line after the output for
@@ -118,7 +118,7 @@ as well as the totals for both:
.Sh DIAGNOSTICS
.Ex -std
.Sh SEE ALSO
-.Xr isspace 3
+.Xr iswspace 3
.Sh COMPATIBILITY
Historically, the
.Nm
@@ -133,7 +133,7 @@ systems after
modified the implementation to be consistent
with the documentation.
This implementation defines a ``word'' in terms of the
-.Xr isspace 3
+.Xr iswspace 3
function, as required by
.St -p1003.2 .
.Sh STANDARDS
diff --git a/usr.bin/wc/wc.c b/usr.bin/wc/wc.c
index 6eb2602..85a90c9 100644
--- a/usr.bin/wc/wc.c
+++ b/usr.bin/wc/wc.c
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <wctype.h>
uintmax_t tlinect, twordct, tcharct;
int doline, doword, dochar, domulti;
@@ -234,8 +235,7 @@ word: gotsp = 1;
p += clen;
if (wch == L'\n')
++linect;
- /* XXX Non-portable; should use iswspace() */
- if (isspace(wch))
+ if (iswspace(wch))
gotsp = 1;
else if (gotsp) {
gotsp = 0;
OpenPOWER on IntegriCloud