From 9ef61c39e995116cfc9f0f0408bb083061fc7f6e Mon Sep 17 00:00:00 2001 From: Connor Lane Smith Date: Sat, 4 Jun 2011 12:27:44 +0100 Subject: [PATCH] sort: fix --- sort.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sort.c b/sort.c index 124ed93..c07702c 100644 --- a/sort.c +++ b/sort.c @@ -44,7 +44,7 @@ main(int argc, char *argv[]) qsort(lines, nlines, sizeof *lines, (int (*)(const void *, const void *))linecmp); for(i = 0; i < nlines; i++) - if(!uflag || i == 0 || strcmp(lines[i], lines[i-1]) == -1) + if(!uflag || i == 0 || strcmp(lines[i], lines[i-1]) != 0) fputs(lines[i], stdout); return EXIT_SUCCESS; }