summaryrefslogtreecommitdiffstats
path: root/usr.bin/wc (follow)
Commit message (Collapse)AuthorAgeFilesLines
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-281-2/+2
| | | | | | value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
* For -w output in -m mode, tweak the handling of bytes that do notschwarze2018-09-301-2/+2
| | | | | | | | form valid UTF-8: treat them as "not a whitespace character" and hence "not a word boundary" in the same way as non-printable characters and NUL bytes. OK millert@
* fix the rest of the bug mitigated in the previous commit:schwarze2018-09-301-2/+3
| | | | | | do not embark on an infinite loop when -m is given and the file contains a NUL character; OK millert@
* Treat NUL like any other byte in the default case; aligns newline countcheloha2018-09-291-3/+4
| | | | | | | | with that of the '-l' case. From David Hines on bugs@. ok millert@
* Use <fcntl.h> instead of <sys/file.h> for open() and friends.guenther2018-04-261-2/+3
| | | | | | | Delete a bunch of unnecessary #includes and sort to match style(9) while doing the above cleanup. ok deraadt@ krw@
* Unify wording for LC_CTYPE in ENVIRONMENT:schwarze2016-10-241-5/+5
| | | | | | * Consistently use "character encoding locale" as suggested by stsp@. * Resolve various gratuitious wording variations. OK jmc@.
* - Removed unnecessary string.h includefcambus2016-09-161-24/+23
| | | | | | | | | | | | | | - Changed 'format_and_print' argument type to int64_t and casting inside the function - Declaring 'print_counts', 'format_and_print', and 'cnt' as static - Remove unnecessary cast for NULL, and (void) casts from printfs, 'mbtowc' and 'format_and_print' calls - In 'cnt', change bufsz type from ssize_t to size_t to avoid converting between pointers to integer types with different sign when calling getline (catched when compiling with Clang) - Use return instead of exit in main OK jung@
* UTF-8 support: implement -m for character countingschwarze2015-12-082-43/+87
| | | | | | | | | and use iswspace(3) for word counting. Requires using getline(3) rather than read(2) to make sure that characters aren't chopped to pieces. Using feedback from millert@ on an earlier version. Feedback and OK tedu@.
* Change all tame callers to namechange to pledge(2).deraadt2015-10-091-3/+3
|
* wc only opens files read-only, proceses them, and spits results to stdout.deraadt2015-10-031-1/+4
| | | | tame "stdio rpath" works, right before calling getopt()
* Back in January, Kaspars at Bankovskis dot net reported that the wc(1)schwarze2015-04-211-15/+10
| | | | | | | manual claims that -m would count characters, while our version of the command actually doesn't, lacking POSIX multibyte support. Since nobody stood up to fix the code, sync the docs with reality for now. OK jmc@
* remove the first comma from constructs like ", and," and ", or,": you can usejmc2015-03-131-3/+3
| | | | | "and" and "or" to join sentence clauses, and you can use commas, but both hinders reading;
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-161-4/+4
| | | | | | | | | possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
* No point in documenting an outright bug fixed in 4.3BSD.bentley2014-11-151-23/+2
| | | | Suggested by schwarze@
* remove erroneous char cast to switch expression processing getopt(3);okan2013-11-271-2/+2
| | | | | | not used in any cases. ok deraadt@, guenther@, millert@
* send a extra space to the bit bucketderaadt2013-11-231-2/+2
|
* simpler prototype repairsderaadt2013-11-121-1/+2
|
* add an EXIT STATUS section for /usr/bin;jmc2010-09-031-3/+3
|
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-271-15/+1
| | | | | | | unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
* replace ".Ar file ..." with ".Ar" whenever possible.sobrado2009-08-161-3/+3
| | | | ok jmc@
* bump the posix reference in STANDARDS to IEEE Std 1003.1-2008, with a fewjmc2009-02-081-3/+3
| | | | updates to follow;
* replace hardcoded exit values with .Ex macros;sobrado2009-01-041-5/+3
| | | | ok jmc@
* do not print spurious whitespace when reading from stdin;otto2008-06-191-4/+7
| | | | from Bernd Ahlers with a twist from me; ok millert@
* convert to new .Dd format;jmc2007-05-311-2/+2
|
* - use a consistent text for STANDARDSjmc2007-05-301-12/+11
| | | | - note which options are extensions to POSIX
* Add -h option to display human-readable numbers.espie2005-10-193-12/+40
| | | | | | | okay otto@, deraadt@, jmc@. (note that is mostly useless from scripts, hence okay as a non-standard option).
* spacingderaadt2005-04-111-5/+5
|
* remove section detailing `file' operand: none of our other pages do itjmc2004-12-191-7/+1
| | | | | | (well, there probably are exceptions) and it's kind of obvious; ok millert@
* - alter .Nd to reflect that characters can be counted alsojmc2004-04-071-5/+11
| | | | | | | | | (syncs description w/ posix) - remove unnecessary .Fl - note that the default listing may show character, rather than byte, count started by PR from Juan Vera (#3738)
* - section reorderjmc2003-06-101-4/+9
| | | | | | | | | - COMPATIBILITY merge - macro cleanup - kill whitespace at EOL - new sentence, new line ssh pages ok markus@
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-032-13/+5
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* typos; jmc@prioris.mini.pw.edu.plderaadt2003-01-121-3/+3
|
* ansideraadt2002-09-171-12/+5
|
* Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.millert2002-02-161-4/+4
|
* kill more registersmpech2001-11-191-7/+7
| | | | millert@ ok
* first pass at a -Wall cleanupderaadt2001-07-121-5/+5
|
* More pedantic man page formatting insanity, lalalaaaron2000-03-231-2/+3
|
* Finish off cleanup usr.bin/ man pages.aaron2000-03-141-19/+23
|
* Some section re-ordering.aaron2000-03-061-11/+11
|
* Finish standardizing options list introduction.aaron2000-03-051-2/+2
|
* Use the AT&T UNIX macros.aaron1999-10-171-1/+6
|
* Remove useless cast to quad_t. Gcc thinks "%qd" in printf is the same as "%lld" so we get a warning on alpha with -Wall. Live with it.millert1999-02-021-5/+5
|
* o Some minor updates from lite2 (mostly in the man page)millert1999-02-022-78/+98
| | | | o Add support for large files by using quads as counters
* be really pedantic about punctuation following -mdoc macro'd textaaron1998-11-041-2/+2
|
* usr.bin/ man page fixes, t-zaaron1998-10-301-3/+3
|
* rcsidderaadt1996-06-263-4/+5
|
* initial import of NetBSD treederaadt1995-10-183-0/+381