apply patches
This commit is contained in:
commit
b2b0ef2f26
|
@ -8,4 +8,4 @@ man_MANS = textwrap.3 dotextwrap.1
|
||||||
|
|
||||||
bin_PROGRAMS = dotextwrap
|
bin_PROGRAMS = dotextwrap
|
||||||
dotextwrap_SOURCES = dotextwrap.c
|
dotextwrap_SOURCES = dotextwrap.c
|
||||||
dotextwrap_LDADD = -ltextwrap
|
dotextwrap_LDADD = libtextwrap.la
|
||||||
|
|
|
@ -78,6 +78,9 @@ proper number of space code (0x20) by \fBtextwrap\fR.
|
||||||
.SH RETURN VALUE
|
.SH RETURN VALUE
|
||||||
\fBtextwrap()\fR returns the line-folded text.
|
\fBtextwrap()\fR returns the line-folded text.
|
||||||
You can free(3) the given value.
|
You can free(3) the given value.
|
||||||
|
|
||||||
|
In case of any error while processing the string, the text <ERR> will be
|
||||||
|
appended to the output and processing will be aborted.
|
||||||
.\" ********************************************************************
|
.\" ********************************************************************
|
||||||
.SH EXAMPLE
|
.SH EXAMPLE
|
||||||
.nf
|
.nf
|
||||||
|
|
|
@ -300,6 +300,14 @@ textwrap(const textwrap_t *prop, const char *text)
|
||||||
|
|
||||||
now = p; /* current character */
|
now = p; /* current character */
|
||||||
ml = mblen(p, MB_CUR_MAX);
|
ml = mblen(p, MB_CUR_MAX);
|
||||||
|
if (ml<0) {
|
||||||
|
/*
|
||||||
|
* stringt_addstr will take care about enough
|
||||||
|
* memory for out
|
||||||
|
*/
|
||||||
|
stringt_addstr(out, " <ERR>");
|
||||||
|
return stringt_destroy_extract(out);
|
||||||
|
}
|
||||||
w = mbwidth(p, ml);
|
w = mbwidth(p, ml);
|
||||||
b = breakable(p, ml, encoding_type);
|
b = breakable(p, ml, encoding_type);
|
||||||
p += ml;
|
p += ml;
|
||||||
|
|
Loading…
Reference in New Issue