sort: fix

This commit is contained in:
Connor Lane Smith 2011-06-04 12:27:44 +01:00
parent ea7563dc0b
commit 9ef61c39e9

2
sort.c
View File

@ -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;
}