mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-10 00:13:04 +01:00
Use the iswspace(3) function now that it's been implemented.
This commit is contained in:
parent
13ee49d316
commit
e58245f7dc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=101670
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user