[hackers] [sbase] sort: ignore trailing newline while sorting || Jakob Kramer

From: <git_AT_suckless.org>
Date: Tue, 06 May 2014 17:21:48 +0200

commit 109e8963f5f82641579f72e4367d427db54dae09
Author: Jakob Kramer <jakob.kramer_AT_gmx.de>
Date: Tue May 6 13:37:05 2014 +0200

    sort: ignore trailing newline while sorting

diff --git a/sort.c b/sort.c
index 1d5f325..26d287d 100644
--- a/sort.c
+++ b/sort.c
_AT_@ -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, '
')) == NULL)
+ end = strchr(line, '
Received on Tue May 06 2014 - 17:21:48 CEST

This archive was generated by hypermail 2.3.0 : Tue May 06 2014 - 17:24:09 CEST