tprintf: Fix color breaking in less mode
commit0757f825dd4b0e3653a98264bbe3933d54b3c1ef
authorVadim Kochan <vadim4j@gmail.com>
Tue, 5 May 2015 07:44:57 +0000 (5 10:44 +0300)
committerTobias Klauser <tklauser@distanz.ch>
Tue, 5 May 2015 09:55:29 +0000 (5 11:55 +0200)
tree8b4bb216ab0460baa32b465808925123369ae854
parentd245603ab331de51d774f3d69ba3689155b0eb53
tprintf: Fix color breaking in less mode

Automatic new line indentation can break terminal ESC color sequence by
inserting new line within it.

Fixed by considering that color ESC sequence is not closed
by 'm' and only after it is closed - print new line with spaces.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
[tk: add comments]
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
tprintf.c