[hackers] [PATCH 1/3][sbase] sort: Fix handling of -k n,n case

From: Richard Ipsum <richardipsum_AT_vx21.xyz>
Date: Tue, 31 Dec 2019 19:50:58 +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 Tue Dec 31 2019 - 20:50:58 CET

This archive was generated by hypermail 2.3.0 : Tue Dec 31 2019 - 21:36:28 CET