commit 9d120b7b3204dc4fa5b90be9ee272f4c35914b15
Author:     FRIGN <[email protected]>
AuthorDate: Mon Mar 7 00:20:24 2016 +0100
Commit:     sin <[email protected]>
CommitDate: Thu Mar 10 08:48:09 2016 +0000

    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.

diff --git a/sort.c b/sort.c
index 00061fd..cb6f851 100644
--- 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;

Reply via email to