Commit Graph

30 Commits

Author SHA1 Message Date
christos 364bef3971 remove unused label 2019-04-23 17:35:10 +00:00
uwe f14670a1d6 Don't pass '-' to getopt(3). My guess is that *very* old getopt
didn't handle "--" terminator, so this code was working around it and
not quite correctly at that.

Fixes weird output from

  $ uniq --long-option
  uniq: uniq: No such file or directory

(for more fun, run that command from /usr/bin as root).

Pointed out by Andreas Krey.
2019-04-23 14:40:12 +00:00
abhinav 77df47bda0 Fix the bug introduced in the previous commit.
The lengths of the lines being compared were not correct. Essentially, we
were comparing the length of the buffers instead of the length of the strings.

This patch also avoids calling skip() twice for the same line.

Thanks to Rin Okuyama for the patch.
2016-10-16 06:17:51 +00:00
abhinav 75088523c3 A small optimization: since we already know the length of the lines, check
if the lenghts are equal before calling strcmp(3). Most of the times, the call
to strcmp(3) can be saved if the lines are not of the same length.

Thanks to Christos for the reviews
2016-10-14 19:43:59 +00:00
wiz 5559f4329b - synchronize `usage' message with man page.
Patch from Bug Hunting.
2012-08-26 14:14:16 +00:00
wiz c33cd716b3 - improve punctuation;
- improve wording (explicitly mention the name of the optional
  additional arguments within the text, using macros as well);
- create separate section, and use `.Ex' macro, for exit status
  information;
- bump date.

Patch from Bug Hunting.
2012-08-26 14:13:50 +00:00
wiz 146c9ced7d Sync usage with man page. 2010-10-06 07:59:18 +00:00
dholland d4471f4981 Allow -c with -d/-u. While uniq -cu isn't that useful, uniq -cd often is.
No objection on tech-userlevel, and the arbitrary restriction has been
irritating me for ages.
2010-10-06 06:43:26 +00:00
lukem c1ceae17f0 Enable WARNS=4 by default for usr.bin, except for:
awk  bdes  checknr  compile_et  error  gss  hxtool  kgetcred  kinit
	klist  ldd  less  lex  locale  login  m4  man  menuc  mk_cmds
	mklocale  msgc  openssl  rpcgen  rpcinfo  sdiff  spell  ssh
	string2key  telnet  tn3270  verify_krb5_conf  xlint
2009-04-14 22:15:16 +00:00
lukem 98e5374ccb Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 14:19:20 +00:00
perry 8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
christos 6acd8da97d Don't limit lines to 8K. 2007-01-06 02:18:24 +00:00
wiz 596987c9f5 Bump date for previous. 2007-01-06 01:15:43 +00:00
christos 1424501a85 Ansi, KNF, no functional change. 2007-01-05 23:17:32 +00:00
jschauma 68ea33e34d Note that uniq uses a max line length of 8192 bytes. 2007-01-05 18:28:13 +00:00
agc 89aaa1bb64 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22365, verified by myself.
2003-08-07 11:13:06 +00:00
itojun eea9ee0720 asprintf is easier and safer 2003-07-14 09:29:21 +00:00
ross 2a76afae02 Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:36:18 +00:00
christos ad5d7c5f6d char -> unsigned char 1998-12-19 23:22:51 +00:00
lukem 8512105c8e WARNSify, fix .Nm usage, deprecate register, getopt returns -1, use <err.h> 1997-10-20 02:27:04 +00:00
jtc be667101f6 Sync with 44lite2 1995-08-31 21:54:51 +00:00
jtc 972ab0a594 Merged with 4.4lite.
Changed to conform to NetBSD's new RCS Id convention.
1994-12-06 07:51:12 +00:00
jtc f7c6bf575a Minor tweaks: including header files to bring prototypes into scope,
explicitly declaring function return values, etc. to make gcc -Wall
shut up.
1993-08-27 22:30:10 +00:00
mycroft e9d867ef50 Add RCS identifiers. 1993-08-01 17:54:45 +00:00
mycroft c3e42d1c64 Add RCS indentifiers. 1993-08-01 07:22:47 +00:00
mycroft 75ff3a90bd Add RCS identifiers. 1993-07-30 23:49:23 +00:00
mycroft dbd4200b5d Latest version from uunet. 1993-07-30 07:35:47 +00:00
deraadt df59495fc3 uniq -c < /dev/null used to fail. fgets return value was ignored.
patch from <sjg@zen.void.oz.au>
1993-07-05 10:21:17 +00:00
mycroft de7626c37e Fix NULL pointer reference. 1993-04-26 15:03:05 +00:00
cgd 61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00