summaryrefslogtreecommitdiff
path: root/src/sort.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sort.c')
-rw-r--r--src/sort.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/sort.c b/src/sort.c
index af4b20c3e..1faf1714d 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -3231,13 +3231,14 @@ write_unique (struct line const *line, FILE *tfp, char const *temp_output)
{
static struct line saved;
- if (!unique)
- write_line (line, tfp, temp_output);
- else if (!saved.text || compare (line, &saved))
+ if (unique)
{
+ if (saved.text && ! compare (line, &saved))
+ return;
saved = *line;
- write_line (line, tfp, temp_output);
}
+
+ write_line (line, tfp, temp_output);
}
/* Merge the lines currently available to a NODE in the binary