sort: fix bug in --debug when \0 is followed by \t
commita2cebacf9748d60d6763f8ada68a10958a9cbda2
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 3 Aug 2010 17:24:11 +0000 (3 10:24 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 3 Aug 2010 17:25:47 +0000 (3 10:25 -0700)
tree4c911b6105aa863c8a9073d262fb3796f8295e7f
parent94615d2acfdccbbeb8eb6f8931d0e252b05e1484
sort: fix bug in --debug when \0 is followed by \t

* src/sort.c (debug_width): New function, which does not stop
counting tabs at \0, and also invokes mbsnwidth.  Stamp out strnlen!
(count_tabs): Remove.
(debug_key): Use debug_width instead of mbsnwidth and count_tabs.
* tests/misc/sort-debug-keys: Check that \0 and \t intermix.
src/sort.c
tests/misc/sort-debug-keys