summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2017-12-24 00:11:43 +0000
committertb <tb@openbsd.org>2017-12-24 00:11:43 +0000
commit11e870de7c27ba263ba06551c5bb9e67b678ea60 (patch)
tree6957f395eae4d8ad7683b44d874adce8a0c75749
parentAs we only use the .tv_sec field, simplify gettimeofday(2) -> time(3). (diff)
downloadwireguard-openbsd-11e870de7c27ba263ba06551c5bb9e67b678ea60.tar.xz
wireguard-openbsd-11e870de7c27ba263ba06551c5bb9e67b678ea60.zip
Avoid comparing equal lines twice when running without -i.
From kshe, ok jca
-rw-r--r--usr.bin/uniq/uniq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/uniq/uniq.c b/usr.bin/uniq/uniq.c
index e2cc67332ca..ae5d76cd24e 100644
--- a/usr.bin/uniq/uniq.c
+++ b/usr.bin/uniq/uniq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uniq.c,v 1.25 2017/12/21 10:05:59 tb Exp $ */
+/* $OpenBSD: uniq.c,v 1.26 2017/12/24 00:11:43 tb Exp $ */
/* $NetBSD: uniq.c,v 1.7 1995/08/31 22:03:48 jtc Exp $ */
/*
@@ -152,7 +152,7 @@ main(int argc, char *argv[])
}
/* If different, print; set previous to new value. */
- if ((!iflag && strcmp(t1, t2)) || strcasecmp(t1, t2)) {
+ if ((iflag ? strcasecmp : strcmp)(t1, t2)) {
show(ofp, prevline);
t1 = prevline;
prevline = thisline;