summaryrefslogtreecommitdiffstats
path: root/lib/fold
Commit message (Collapse)AuthorAgeFilesLines
* lib/fold: fix warning with -DDEBUGJeremy Kerr2014-12-011-1/+1
| | | | | | | | | | | | | When compiling the fold code with DEBUG defined, we get: ../lib/fold/fold.c: In function 'fold_text': ../lib/fold/fold.c:37:3: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits] assert(bytes >= 0); ^ We should be comparing with != (size_t)-1, not >= 0 Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/fold: Add support for multibyte stringsJeremy Kerr2014-09-231-11/+59
| | | | | | | | | | 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: Add text fold utilityJeremy Kerr2014-01-312-0/+71
We want to fold help text into the ncurses UI, so add a little module to split text into lines. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud