]> git.refcnt.org Git - colorize.git/commit
Clean text from color escape sequences
authorSteven Schubiger <stsc@refcnt.org>
Thu, 7 Feb 2013 22:50:09 +0000 (23:50 +0100)
committerSteven Schubiger <stsc@refcnt.org>
Thu, 7 Feb 2013 22:50:09 +0000 (23:50 +0100)
commit5b543402df3ecb2e5c5cb973ee4951d22f9cd52c
treeca6011873be4aa9f1119ed952d601574f8028688
parent0802a010b347abd0172beb4411cd2b6af946f73b
Clean text from color escape sequences

In order to handle end-of-buffer reads with partial line chunks,
merge those when cleaning text.  Pass each line then to the offset
extracting function which gathers begin/end offsets of escape
sequences.  Finally, for printing cleaned lines of text, omit all
color escape sequences as defined by their set of offsets (and
restore characters temporarily overwritten with terminating NUL).

Furthermore, add a basic string concatenation function and wrap
the free memory function to have it nullify pointers.
colorize.c