]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lib/tt: count read cells, improve \x?? hex encoding
authorKarel Zak <kzak@redhat.com>
Mon, 6 Aug 2012 10:50:09 +0000 (12:50 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 6 Aug 2012 10:50:09 +0000 (12:50 +0200)
commitfce849325c6409e36617c580bccafe1464803aa8
tree08e972def9e091fab3c019c93da34214e37a705a
parent5f7c18902fe2cd1e8b7d8d205680546d056000f7
lib/tt: count read cells, improve \x?? hex encoding

 * use wcwidth() to count real number of columns required for
   multibyte strings

 * encode control characters with \x?? in raw and export (NAME=data) outputs

 * use \x?? for controls and non-printable characters in the default outputs

 * use \x?? to encode already existing hex sequences, for example

/mnt/ugly\x20space  --->  /mnt/ugly\x5cx20space

   this is not used in the default output, but in raw/export outputs
   only (which is designed for scripts).

Signed-off-by: Karel Zak <kzak@redhat.com>
lib/tt.c