summaryrefslogtreecommitdiffstats
path: root/usr.bin/uniq
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-06-06 03:13:08 +0000
committertjr <tjr@FreeBSD.org>2002-06-06 03:13:08 +0000
commit264da240fc0d604979381ef33b536061dee8a7f9 (patch)
tree68133c65334f63c51ddd88299954194bbe067a16 /usr.bin/uniq
parent050d70384656c280e4398fe89ea68c98dde78be9 (diff)
downloadFreeBSD-src-264da240fc0d604979381ef33b536061dee8a7f9.zip
FreeBSD-src-264da240fc0d604979381ef33b536061dee8a7f9.tar.gz
Compare lines with strcmp(), not strcoll(). We are interested only in
equality, not ordering.
Diffstat (limited to 'usr.bin/uniq')
-rw-r--r--usr.bin/uniq/uniq.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/usr.bin/uniq/uniq.c b/usr.bin/uniq/uniq.c
index 701e58b..4727c14 100644
--- a/usr.bin/uniq/uniq.c
+++ b/usr.bin/uniq/uniq.c
@@ -67,7 +67,6 @@ void show(FILE *, char *);
char *skip(char *);
void obsolete(char *[]);
static void usage(void);
-int stricoll(char *, char*);
int
main (argc, argv)
@@ -152,9 +151,9 @@ main (argc, argv)
/* If different, print; set previous to new value. */
if (iflag)
- comp = stricoll(t1, t2);
+ comp = strcasecmp(t1, t2);
else
- comp = strcoll(t1, t2);
+ comp = strcmp(t1, t2);
if (comp) {
show(ofp, prevline);
@@ -252,18 +251,3 @@ usage()
"usage: uniq [-c | -d | -u] [-i] [-f fields] [-s chars] [input [output]]\n");
exit(1);
}
-
-int
-stricoll(s1, s2)
- char *s1, *s2;
-{
- char *p, line1[MAXLINELEN], line2[MAXLINELEN];
-
- for (p = line1; *s1; s1++)
- *p++ = tolower((unsigned char)*s1);
- *p = '\0';
- for (p = line2; *s2; s2++)
- *p++ = tolower((unsigned char)*s2);
- *p = '\0';
- return strcoll(line1, line2);
-}
OpenPOWER on IntegriCloud