sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit 109e8963f5f82641579f72e4367d427db54dae09
parent 0723c8d32eabcb326381235e4aed265ee93af7b4
Author: Jakob Kramer <jakob.kramer@gmx.de>
Date:   Tue,  6 May 2014 13:37:05 +0200

sort: ignore trailing newline while sorting

Diffstat:
sort.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sort.c b/sort.c @@ -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)