Commit Graph

42 Commits

Author SHA1 Message Date
eadler
1ef5fe44d3 Remove trailing whitespace per mdoc lint warning
Disussed with:	gavin
No objection from:	doc
Approved by:	joel
MFC after:	3 days
2012-03-29 05:02:12 +00:00
imp
8d68c85340 Add helpful clarification text. While not strictly necessary, these
few words make this man page much easier to understand without
re-reading prior parts of the man page.
2011-11-16 22:02:59 +00:00
ed
ba068938d1 Mark global functions and/or variables in comm(1) static where possible.
This allows compilers and static analyzers to more thorough analysis.
2011-11-06 18:49:10 +00:00
joel
29af67e52c 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
uqs
3960614646 mdoc: order prologue macros consistently by Dd/Dt/Os
Although groff_mdoc(7) gives another impression, this is the ordering
most widely used and also required by mdocml/mandoc.

Reviewed by:	ru
Approved by:	philip, ed (mentors)
2010-04-14 19:08:06 +00:00
ache
d22c80dc91 Add SIZE_MAX overflow check 2010-03-09 21:06:17 +00:00
ache
a97c77aebb Rewrite input processing to not exit with error on the first EILSEQ found
in the input data but fallback to "binary comparison" instead.

POSIX says: "The input files shall be text files", nothing more,
so the text file with illegal sequence is valid input.
BTW, GNU sort does not fails on EILSEQ too.
2010-03-08 22:27:46 +00:00
jh
34aba95524 - Prevent overflowing of the buffer length variable in getline() by
limiting its maximum value.
- Exit if reallocf(3) fails in getline(). Failure was silently
  considered as end-of-file.

Reviewed by:	ghelmer
Approved by:	trasz (mentor)
2009-12-16 14:34:48 +00:00
jh
6f2f9130ae Don't read the newline character to line buffer because lines are passed
to wcscoll(3). Newline characters could cause incorrect results when
comparing lines.

Also, if an input line didn't contain a newline character, it was
omitted from the output. According to my interpretation, SUSv3 requires
that the newline is always printed.

Add regression tests for the cases. [1]

PR:		bin/140976
Submitted by:	D'Arcy Cain (original version) [1]
Approved by:	trasz (mentor)
2009-12-12 18:18:46 +00:00
jh
1cb0051d8f The input line length limit mentioned on the manual page was removed by
r179374.

Approved by:	trasz (mentor)
2009-12-12 18:04:50 +00:00
ghelmer
1f11917771 Similar to changes previously made to src/usr.bin/uniq/uniq.c,
fix truncation of lines at LINE_MAX characters by dynamically
extending line buffers.
2008-05-28 14:13:35 +00:00
tjr
dc2c21960c Document input line length limit. 2005-01-25 22:32:48 +00:00
ru
6cc4b6c220 Added the EXIT STATUS section where appropriate. 2005-01-17 07:44:44 +00:00
tjr
3f44360851 Document the -i option as being a non-standard extension. 2004-07-02 22:56:14 +00:00
tjr
cf2cc54485 Add support for multibyte characters. 2004-07-02 22:48:29 +00:00
tjr
2ec6e3b662 Document the fact that comm(1) does not recognize multibyte characters
in its input. Although doing so would require only trivial changes,
it would be incompatible with the ordering used by sort(1), which is the
primary source of comm's input.
2004-06-24 15:57:56 +00:00
dwmalone
bf25e6dcaf ANSIify function definitions to avoid a warning.
Minor constness changes.
2002-07-28 15:28:38 +00:00
tjr
0372ab2f7b Add a History section. comm(1) appeared in V4. 2002-05-28 09:35:30 +00:00
tjr
14396afdcd No need to handle '-' explicitly in getopt() loop.
Obtained from:	NetBSD
2002-05-28 09:26:08 +00:00
charnier
a07fb1cc07 Use `The .Nm utility' 2002-04-19 23:44:58 +00:00
imp
74d826c7a6 remove __P 2002-03-22 01:22:50 +00:00
markm
ae2558974f Remove leaf node WARNS?=2 (that mainly I added). This should
help the GCC3 transition and CURRENT in general.
2002-02-08 22:31:43 +00:00
ache
1088528f87 Use LC_ALL to pick LC_COLLATE too (for strcoll()) 2001-12-30 19:30:10 +00:00
dwmalone
d9613ea383 Style improvements recommended by Bruce as a follow up to some
of the recent WARNS commits. The idea is:

1) FreeBSD id tags should follow vendor tags.
2) Vendor tags should not be compiled (though copyrights probably should).
3) There should be no blank line between including cdefs and __FBSDIF.
2001-12-10 21:13:08 +00:00
markm
45888ee363 Use __FBSDID(). 2001-12-02 23:52:47 +00:00
markm
b8b83fee29 WARNS=2 fixup. 2001-12-02 13:18:59 +00:00
ru
bde8ec1b70 mdoc(7) police: utilize the new .Ex macro. 2001-08-15 09:09:47 +00:00
dd
dc0185a459 Include missing header files which define functions for which gcc has
builtins (e.g., exit, strcmp).
2001-06-24 19:50:42 +00:00
charnier
54fa1fab44 Rework diagnostics text
Remove unused #include
2001-02-06 20:01:40 +00:00
ru
0d1334ca0c mdoc(7) police: use the new features of the Nm macro. 2000-11-20 19:21:22 +00:00
ache
5ee94caf28 fix the same typo as in uniq 1999-12-10 13:27:02 +00:00
ache
25e78d8b60 toupper -> tolower to match changed behaviour of new grep case fold 1999-10-29 05:11:06 +00:00
ache
a9f235047c Cosmetique: use standard prototypes scheme
Back out prev change: toupper is more compatible with sort -f
1999-10-24 04:47:57 +00:00
ache
c870ad3624 toupper->tolower to match what strcasecmp does 1999-10-24 04:21:42 +00:00
ache
c594629213 Localize it
PR:		11221
Submitted by:	Grigoriy Strokin <grg@philol.msu.ru>
1999-10-24 03:42:35 +00:00
peter
3b842d34e8 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
archie
167c036e91 Tweaks to allow compiling -Wall (mostly adding "const" to char rcsid[]). 1998-12-06 22:58:23 +00:00
joerg
caa2e7e2da Teach comm(1) and uniq(1) about an option for case-insensitive work.
PR:		3042
Submitted by:	graphix@iastate.edu (Kent Vander Velden)
1997-09-07 15:09:22 +00:00
charnier
6f0d89b1c2 Use err(3). Add DIAGNOSTIC section name in man page. 1997-06-30 06:40:16 +00:00
imp
141381e1cb compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-29 04:34:07 +00:00
peter
297505f8fa Import some parts of CSRG 4.4BSD-Lite2 usr.bin sources to fix tree build. 1997-03-11 13:08:12 +00:00
rgrimes
f9ab90d9d6 BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00