sbase

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

commit 8c88b2cd5eac4cb7eb22e4a50d018a433773449d
parent d5f9a69ca16cd04da634b66d6fd58987d403257a
Author: FRIGN <dev@frign.de>
Date:   Mon Mar  7 00:20:24 +0100

Actually move past the field separator

Previously, sort(1) failed on key-based sorting and was caught in an
infinite loop with the c-flag.

Diffstat:
sort.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sort.c b/sort.c @@ -62,8 +62,9 @@ skipcolumn(struct linebufline *a, int skip_to_next_col) if (fieldsep) { if ((s = memmem(a->data, a->len, fieldsep, fieldseplen))) { if (skip_to_next_col) { - a->len = a->len - (s - a->data); + s += fieldseplen; a->data = s; + a->len = a->len - (s - a->data); } } else { a->data += a->len - 1;