=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/uniq/uniq.c,v retrieving revision 1.24 retrieving revision 1.25 diff -c -r1.24 -r1.25 *** src/usr.bin/uniq/uniq.c 2015/12/19 10:21:01 1.24 --- src/usr.bin/uniq/uniq.c 2017/12/21 10:05:59 1.25 *************** *** 1,4 **** ! /* $OpenBSD: uniq.c,v 1.24 2015/12/19 10:21:01 schwarze Exp $ */ /* $NetBSD: uniq.c,v 1.7 1995/08/31 22:03:48 jtc Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: uniq.c,v 1.25 2017/12/21 10:05:59 tb Exp $ */ /* $NetBSD: uniq.c,v 1.7 1995/08/31 22:03:48 jtc Exp $ */ /* *************** *** 47,53 **** #define MAXLINELEN (8 * 1024) ! int cflag, dflag, uflag; int numchars, numfields, repeats; FILE *file(char *, char *); --- 47,53 ---- #define MAXLINELEN (8 * 1024) ! int cflag, dflag, iflag, uflag; int numchars, numfields, repeats; FILE *file(char *, char *); *************** *** 70,76 **** err(1, "pledge"); obsolete(argv); ! while ((ch = getopt(argc, argv, "cdf:s:u")) != -1) { const char *errstr; switch (ch) { --- 70,76 ---- err(1, "pledge"); obsolete(argv); ! while ((ch = getopt(argc, argv, "cdf:is:u")) != -1) { const char *errstr; switch (ch) { *************** *** 87,92 **** --- 87,95 ---- errx(1, "field skip value is %s: %s", errstr, optarg); break; + case 'i': + iflag = 1; + break; case 's': numchars = (int)strtonum(optarg, 0, INT_MAX, &errstr); *************** *** 149,155 **** } /* If different, print; set previous to new value. */ ! if (strcmp(t1, t2)) { show(ofp, prevline); t1 = prevline; prevline = thisline; --- 152,158 ---- } /* If different, print; set previous to new value. */ ! if ((!iflag && strcmp(t1, t2)) || strcasecmp(t1, t2)) { show(ofp, prevline); t1 = prevline; prevline = thisline; *************** *** 257,263 **** extern char *__progname; (void)fprintf(stderr, ! "usage: %s [-c] [-d | -u] [-f fields] [-s chars] [input_file [output_file]]\n", __progname); exit(1); } --- 260,266 ---- extern char *__progname; (void)fprintf(stderr, ! "usage: %s [-ci] [-d | -u] [-f fields] [-s chars] [input_file [output_file]]\n", __progname); exit(1); }