diff options
author | Pádraig Brady <P@draigBrady.com> | 2015-12-13 02:14:06 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2015-12-14 13:40:51 +0000 |
commit | 872c0df857d322f8119c64853d042f17c1913c3a (patch) | |
tree | c81e8e0ff1b73ff1dbfc6d99da4ab706a25e7b8a /tests/misc | |
parent | 1118f32145049cc4b949e89eda89a0ed612755de (diff) | |
download | coreutils-872c0df857d322f8119c64853d042f17c1913c3a.tar.xz |
sort: fix --debug marking for -b -k1.x
We were erroneously skipping blanks in the marked comparison
_after_ the key start offset was applied.
* src/sort.c (debug_keys): Don't skip starting blanks
if already handled by begfield().
* tests/misc/sort-debug-keys.sh: Add a test case.
* NEWS: Mention the bug fix.
Fixes http://bugs.gnu.org/22155
Diffstat (limited to 'tests/misc')
-rwxr-xr-x | tests/misc/sort-debug-keys.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/misc/sort-debug-keys.sh b/tests/misc/sort-debug-keys.sh index a0a287401..fadd19c6a 100755 --- a/tests/misc/sort-debug-keys.sh +++ b/tests/misc/sort-debug-keys.sh @@ -238,6 +238,10 @@ A>chr10 ^ no match for key B>chr1 ^ no match for key +1 2 + __ +1 3 + __ EOF ( @@ -282,6 +286,9 @@ printf '\0\ta\n' | sort -s -k2b,2 --debug | tr -d '\0' # Check that key end before key start is not underlined printf 'A\tchr10\nB\tchr1\n' | sort -s -k2.4b,2.3n --debug + +# Ensure that -b applied before -k offsets +printf '1 2\n1 3\n' | sort -s -k1.2b --debug ) > out compare exp out || fail=1 |