<feed xmlns='http://www.w3.org/2005/Atom'>
<title>talos-petitboot/lib/fold, branch master</title>
<subtitle>Blackbird™ petitboot sources</subtitle>
<id>https://git.raptorcs.com/git/talos-petitboot/atom?h=master</id>
<link rel='self' href='https://git.raptorcs.com/git/talos-petitboot/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/'/>
<updated>2016-03-15T03:34:41+00:00</updated>
<entry>
<title>lib/fold: Catch error case from mbrtowc()</title>
<updated>2016-03-15T03:34:41+00:00</updated>
<author>
<name>Sam Mendoza-Jonas</name>
<email>sam@mendozajonas.com</email>
</author>
<published>2016-03-03T02:31:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=5c3c324cc42f179fb41ca825fbce06bc445c730b'/>
<id>urn:sha1:5c3c324cc42f179fb41ca825fbce06bc445c730b</id>
<content type='text'>
The assert() statement in fold_text() only evaluates in a debug build.
If mbrtowc() encounters an error return the portion of the string that
has been parsed and stop.

This avoids an issue with glibc 2.22 where previous calls to
setlocale() failed and set an unsuitable locale. Since the error was not
caught this resulted in an infinite loop when trying to access the
Language screen.

Signed-off-by: Sam Mendoza-Jonas &lt;sam@mendozajonas.com&gt;
</content>
</entry>
<entry>
<title>lib/fold: Handle extra mbrtowc return case</title>
<updated>2015-08-25T03:29:48+00:00</updated>
<author>
<name>Samuel Mendoza-Jonas</name>
<email>sam.mj@au1.ibm.com</email>
</author>
<published>2015-08-20T06:32:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=9818a3cd88578ffadb4ff3f5562e468e3b4b6f95'/>
<id>urn:sha1:9818a3cd88578ffadb4ff3f5562e468e3b4b6f95</id>
<content type='text'>
Commit 9781a370 ("Handle mblen return code when n is zero.") in glibc
changes the return value for when the number of bytes ('n') is zero.
Add an extra condition to detect if we've reached the end of the buffer.

Signed-off-by: Samuel Mendoza-Jonas &lt;sam.mj@au1.ibm.com&gt;
</content>
</entry>
<entry>
<title>lib/fold: fix warning with -DDEBUG</title>
<updated>2014-12-01T03:53:23+00:00</updated>
<author>
<name>Jeremy Kerr</name>
<email>jk@ozlabs.org</email>
</author>
<published>2014-11-28T03:42:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=d28e414354d791a8c010cf6069bfc549d4343811'/>
<id>urn:sha1:d28e414354d791a8c010cf6069bfc549d4343811</id>
<content type='text'>
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 &gt;= 0 is always true [-Werror=type-limits]
   assert(bytes &gt;= 0);
   ^

We should be comparing with != (size_t)-1, not &gt;= 0

Signed-off-by: Jeremy Kerr &lt;jk@ozlabs.org&gt;
</content>
</entry>
<entry>
<title>lib/fold: Add support for multibyte strings</title>
<updated>2014-09-23T06:47:58+00:00</updated>
<author>
<name>Jeremy Kerr</name>
<email>jk@ozlabs.org</email>
</author>
<published>2014-09-23T06:46:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=3aef1b6d1f465596ebf7883a50efcf4d6f0ffcf4'/>
<id>urn:sha1:3aef1b6d1f465596ebf7883a50efcf4d6f0ffcf4</id>
<content type='text'>
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 &lt;jk@ozlabs.org&gt;
</content>
</entry>
<entry>
<title>lib/fold: Add text fold utility</title>
<updated>2014-01-31T00:46:34+00:00</updated>
<author>
<name>Jeremy Kerr</name>
<email>jk@ozlabs.org</email>
</author>
<published>2013-12-10T06:12:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=485680a5bfeb952fd652a59efcce35636d6aec00'/>
<id>urn:sha1:485680a5bfeb952fd652a59efcce35636d6aec00</id>
<content type='text'>
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 &lt;jk@ozlabs.org&gt;
</content>
</entry>
</feed>
