sort: ignore trailing newline while sorting

This commit is contained in:
Jakob Kramer 2014-05-06 13:37:05 +02:00 committed by sin
parent 0723c8d32e
commit 109e8963f5

3
sort.c
View File

@ -245,7 +245,8 @@ columns(char *line, const struct keydef *kd)
else
end = end_column(end);
} else {
end = line + strlen(line);
if((end = strchr(line, '\n')) == NULL)
end = strchr(line, '\0');
}
if((res = strndup(start, end - start)) == NULL)