sort: ignore trailing newline while sorting
This commit is contained in:
parent
0723c8d32e
commit
109e8963f5
3
sort.c
3
sort.c
|
@ -245,7 +245,8 @@ columns(char *line, const struct keydef *kd)
|
||||||
else
|
else
|
||||||
end = end_column(end);
|
end = end_column(end);
|
||||||
} else {
|
} else {
|
||||||
end = line + strlen(line);
|
if((end = strchr(line, '\n')) == NULL)
|
||||||
|
end = strchr(line, '\0');
|
||||||
}
|
}
|
||||||
|
|
||||||
if((res = strndup(start, end - start)) == NULL)
|
if((res = strndup(start, end - start)) == NULL)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user