lib/fold: Add support for multibyte strings
authorJeremy Kerr <jk@ozlabs.org>
Tue, 23 Sep 2014 06:46:06 +0000 (14:46 +0800)
committerSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Tue, 23 Sep 2014 06:47:58 +0000 (16:47 +1000)
commit3aef1b6d1f465596ebf7883a50efcf4d6f0ffcf4
treec1ff2d5ccb4ba0d5b0ef1af0f02bcad528ce7d5b
parent73ee21af6d0a379a104a21b7569331284b3659b7
lib/fold: Add support for multibyte strings

Currently, the fold_text function doesn't understand multibyte strings,
so may break a line in the middle of a multibyte sequence.

This change adds multibyte-awareness to the fold code, and uses proper
width calculations for the contents of the folded string.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
lib/fold/fold.c
test/lib/test-fold.c