Use the iswspace(3) function now that it's been implemented.

This commit is contained in:
Tim J. Robbins 2002-08-11 10:52:13 +00:00
parent 13ee49d316
commit e58245f7dc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=101670
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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;