Commit Graph

26 Commits

Author SHA1 Message Date
Tim J. Robbins
0cd82603c0 Remove a bogus check that caused empty lines not to be counted when the
-c option was given.

Noticed by:	sf
2004-09-14 12:01:18 +00:00
Tim J. Robbins
3fead394ea Add support for multibyte characters. 2004-07-02 23:43:05 +00:00
David Malone
f4ac32def2 ANSIify function definitions.
Add some constness to avoid some warnings.
Remove use register keyword.
Deal with missing/unneeded extern/prototypes.
Some minor type changes/casts to avoid warnings.

Reviewed by:	md5
2002-09-04 23:29:10 +00:00
Tim J. Robbins
7dd4ac68f1 Use err instead of errx when malloc fails. "malloc" is not a helpful
error message.
2002-07-05 09:28:13 +00:00
Tim J. Robbins
382ac430cd Skip fields in the manner required by POSIX, and the way V7 did it.
MFC after:	1 week
2002-06-21 07:59:31 +00:00
Tim J. Robbins
4e774f7fbe Newline characters should not participate in line comparisons. Only apparent
when -s is used or the last line of the file is missing a newline.
Noticed by the textutils test suite.

MFC after:	1 week
2002-06-21 07:08:34 +00:00
Andrey A. Chernov
e12155c834 Back out rev 1.19 because
1) It breaks uniq for real life languages when "substitute" directive used in
the collating table.
2) It breaks uniq usage in tool chain with other localized utilities which
use collate.
3) To follow LC_COLLATE it is directly allowed for uniq
by POSIX P1003.1 Draft7 (7.3.2). It means that rev 1.19 gains no additional
POSIX conformance.
2002-06-06 13:44:14 +00:00
Tim J. Robbins
5935c07540 Compare lines with strcmp(), not strcoll(). We are interested only in
equality, not ordering.
2002-06-06 03:13:08 +00:00
Tim J. Robbins
6a8be5c4f2 Sync usage() with manual page synopsis. 2002-06-06 03:05:30 +00:00
Tim J. Robbins
38b1ff46af Accept an input file name of "-" to mean standard input, as required by
P1003.2.
2002-05-30 00:07:14 +00:00
Tim J. Robbins
a9986a105a Fields should be separated by <blank>s, not <space>s according to P1003.2. 2002-05-29 23:55:44 +00:00
Tim J. Robbins
fc63032590 Don't bother trying to handle "-" arguments ourselves, getopt(3) already
does this for us.
2002-05-29 23:52:55 +00:00
Andrey A. Chernov
b285e2683f Use LC_ALL to pick collate
Noticed by:	tjr
2002-04-19 08:16:01 +00:00
Warner Losh
3f330d7d1a remove __P 2002-03-22 01:42:45 +00:00
David Malone
c83caf7b8d Warns cleanups. Add FreeBSD ID to Makefile. 2001-12-03 21:37:35 +00:00
Andrey A. Chernov
579f26f4a8 fix fatal typo 1999-12-10 13:06:53 +00:00
Andrey A. Chernov
ff6a49c924 toupper -> tolower to match changed behaviour of new grep case fold 1999-10-29 05:11:06 +00:00
Andrey A. Chernov
e91cb30636 Cosmetique: use standard prototypes scheme
Back out prev. change: toupper is more compatible with sort -f
1999-10-24 04:41:31 +00:00
Andrey A. Chernov
4346bfd3f0 toupper->tolower to match what strcasecmp does 1999-10-24 04:21:42 +00:00
Andrey A. Chernov
c02e589456 Use strcoll to provide the same results as sort and comm
Use LINE_MAX for max line size (as comm does)
1999-10-24 04:08:15 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Andrey A. Chernov
0c312497c7 Localize it 1998-03-08 20:56:43 +00:00
Joerg Wunsch
2ca7dc1598 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
Philippe Charnier
213915d456 Use err(3) instead of local redefinition. 1997-08-21 06:51:10 +00:00
Warner Losh
1c8af87873 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 Wemm
0da30e9aa7 Import some parts of CSRG 4.4BSD-Lite2 usr.bin sources to fix tree build. 1997-03-11 13:08:12 +00:00