Commit Graph

61 Commits

Author SHA1 Message Date
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Bryan Drewery
8ded906d2a Fix SIGINFO race causing final results to be lost to stderr.
If a SIGINFO comes in after the file is read then the 'siginfo' flag is set to
1 and the next call to show_cnt() (at exit) would print the data to stderr
rather than the expected stdout.

This was found with spamming Poudriere with SIGINFO which caused a 'wc -l'
execution to return no data rather than an expected number.

MFC after:	2 weeks
2015-04-16 21:44:35 +00:00
Marcel Moolenaar
399d34850f Close the file list before opening the container that holds the
totals, otherwise we end up emitting invalid JSON -- provided
libxo does not prevent us from doing that.

PR:		197499
Submitted by:	allanjude@
2015-02-11 17:56:24 +00:00
Baptiste Daroussin
3e11bd9e2a Convert to usr.bin/ to LIBADD
Reduce overlinking
2014-11-25 14:29:10 +00:00
Simon J. Gerraty
488c975a1f Updated/new dependencies 2014-11-19 07:10:38 +00:00
Simon J. Gerraty
9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Marcel Moolenaar
985c93f0b4 Fix a SIGSEGV when emitting XML or JSON when reading stdin. In that
case the file variable is NULL.
2014-11-07 01:36:20 +00:00
Marcel Moolenaar
c61e3115fe Separate references by a comma. 2014-11-06 16:19:21 +00:00
Marcel Moolenaar
bf0df86979 Document that wc(1) supports libxo(3). 2014-11-05 04:09:10 +00:00
Marcel Moolenaar
6711c4827a Convert to use libxo.
Obtained from:	Phil Shafer <phil@juniper.net>
Sponsored by:	Juniper Networks, Inc.
2014-11-05 04:02:25 +00:00
Simon J. Gerraty
fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty
76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty
7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty
f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Marcel Moolenaar
7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Ed Schouten
8df975a218 Add missing static keywords to wc(1) 2011-11-06 08:19:00 +00:00
Joel Dahl
da52b4caaf Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with:	imp, rwatson
2010-12-11 08:32:16 +00:00
Pawel Jakub Dawidek
c9a9640635 Use better type for siginfo (volatile sig_atomic_t instead of int).
Pointed out by:	jh
2010-05-17 19:13:49 +00:00
Pawel Jakub Dawidek
f09bc09332 On SIGINFO print current values on stderr. 2010-05-16 21:06:26 +00:00
Ed Schouten
b7946da96b Build usr.bin/ with WARNS=6 by default.
Also add some missing $FreeBSD$ to keep svn happy.
2010-01-02 10:27:05 +00:00
Ed Schouten
0970727f4f Add missing `void' keyword for function without arguments. 2009-12-29 08:54:03 +00:00
Giorgos Keramidas
f45dd01002 Add a -L option to wc(1), for finger compatibility with the GNU
wc utility.  The -L option can be used to report the length of
the longest line wc has seen in one or more files.  It is
disabled by default, and wc uses the standard `-lwc'.

Submitted by:	Sheldon Givens, sheldon at sigsegv.ca
Reviewed by:	kib
MFC after:	1 week
2008-12-06 19:21:56 +00:00
Ruslan Ermilov
cf1fd21b68 Prevent a line from being broken on a line boundary. 2006-12-21 22:59:07 +00:00
Ruslan Ermilov
f0dd79bced Improve markup. 2006-12-21 22:44:41 +00:00
Tom Rhodes
a1b763cac1 Fix mismerge.
Noticed by:	tjr
2005-02-26 04:14:20 +00:00
Tom Rhodes
c566c001e6 Add better mdoc(7) mark up, clean up wording, better describe the effects
of some arguments.

PR:				47705
Based on a patch submitted by:	Gary W. Swearingen <swear@attbi.com>
Glanced at by:			simon
2005-02-23 22:40:45 +00:00
Ruslan Ermilov
0227791b40 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
Ruslan Ermilov
6c7216df78 Sort sections. 2005-01-18 13:43:56 +00:00
Ruslan Ermilov
a866e17077 Added the EXIT STATUS section where appropriate. 2005-01-17 07:44:44 +00:00
Ruslan Ermilov
4438d91ea2 Scheduled mdoc(7) sweep. 2005-01-11 10:32:52 +00:00
Josef El-Rayes
806abfccac Remove warnings and make wc WARNS=6 clean.
Add FreeBSD Id to Makefile.

Approved by:	ssouhlal
2004-12-27 22:27:56 +00:00
Ruslan Ermilov
557b7fa148 Deal with double whitespace. 2004-07-03 00:24:45 +00:00
Tim J. Robbins
149a123b34 Improve robustness of multibyte character handling (-m option), and
simplify the read buffering now that we can feed partial multibyte
characters to mbrtowc().
2004-04-09 11:17:29 +00:00
Ruslan Ermilov
06e482e60a mdoc(7) police: markup polishing.
Approved by:	re
2002-11-26 17:33:37 +00:00
Tim J. Robbins
98c385e7d6 Locale environment variables influence wc(1) regardless of whether the
-m option is specified; correct ENVIRONMENT section.
2002-08-11 10:54:19 +00:00
Tim J. Robbins
e58245f7dc Use the iswspace(3) function now that it's been implemented. 2002-08-11 10:52:13 +00:00
Tim J. Robbins
abd0c85dcd When counting words, check the correct character variable to see whether it's
a space or not.

Noticed by: bde
2002-06-16 06:04:43 +00:00
Tim J. Robbins
a1a27143bd fstat() returns information about the target of any symbolic link that
was opened, not the link itself. Remove dead code.
2002-06-15 08:31:19 +00:00
Tim J. Robbins
e785a241f2 Correct the Standards section: wc is a utility, not a function. 2002-06-13 13:18:57 +00:00
Tim J. Robbins
561a45cac3 Bump document date for previous commit. 2002-06-13 13:17:00 +00:00
Tim J. Robbins
ebb42aee31 Add the -m option, which counts characters (as opposed to -c, which
counts bytes). In locales that don't have multibyte characters, -m
is effectively an alias for -c.

This brings wc(1) up to P1003.1-2001 conformance.
2002-06-13 12:48:50 +00:00
Warner Losh
3f330d7d1a remove __P 2002-03-22 01:42:45 +00:00
Mike Barcroft
064692095c Leave the `copyright' variable exposed, since the main purpose of it
is to put a copyright in the object file.

Submitted by:	bde
2002-03-07 10:06:00 +00:00
Mike Barcroft
a821e36e41 Fix vendor ID (mostly obtained from rev 1.1).
Make use of `static' storage-class for local functions.

Replace uses of `u_quad_t' with `uintmax_t'.
2002-02-28 11:02:49 +00:00
Mark Murray
7a8fb588c7 WARNS=2 fix, use __FBSDID().
Not added to Makefgile as WARNS=2 will be made default.
2001-12-11 22:23:53 +00:00
Ruslan Ermilov
d628d776c4 mdoc(7) police: utilize the new .Ex macro. 2001-08-15 09:09:47 +00:00
Ruslan Ermilov
753d686d34 mdoc(7) police: s/BSD/.Bx/ where appropriate. 2001-08-14 10:01:54 +00:00
Ruslan Ermilov
8fe908ef0c mdoc(7) police: use the new features of the Nm macro. 2000-11-20 19:21:22 +00:00
Philippe Charnier
dbb9d8f826 Add DIAGNOSTICS section name 2000-03-26 15:06:46 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00