[hackers] [PATCH] sort: Fix handling of -k n,n case when -t in use

From: Richard Ipsum <richardipsum_AT_vx21.xyz>
Date: Sun, 29 Dec 2019 13:50:53 +0000

When field_start is equal to field_end use field N as the sort key.
---
 sort.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/sort.c b/sort.c
index 9706e8f..941b694 100644
--- a/sort.c
+++ b/sort.c
_AT_@ -70,6 +70,9 @@ skipcolumn(struct line *a, int skip_to_next_col)
 				s += fieldseplen;
 				a->data = s;
 				a->len = a->len - (s - a->data);
+			} else {
+				a->data = s;
+				a->len = 1;
 			}
 		} else {
 			a->data += a->len - 1;
-- 
2.24.1
Received on Sun Dec 29 2019 - 14:50:53 CET

This archive was generated by hypermail 2.3.0 : Sun Dec 29 2019 - 15:00:24 CET