1
Description: Text incorrectly wrapping at combining characters
2
Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=570630
3
Author: Theppitak Karoonboonyanan
5
Last-Updated: 2010-02-20
7
diff -ruN8p newt-0.52.11-old/textbox.c newt-0.52.11/textbox.c
8
--- newt-0.52.11-old/textbox.c 2010-02-20 21:22:43.000000000 +0700
9
+++ newt-0.52.11/textbox.c 2010-02-20 21:23:04.000000000 +0700
10
@@ -205,34 +205,36 @@ static void doReflow(const char * text,
11
fprintf(stderr,"adding %d\n",((width / 2) - (len)) / 2);
13
howbad += ((width / 2) - (len)) / 2;
18
const char *spcptr = NULL;
20
+ int spc =0,w2, x, w;
24
- for (i = 0; i < width - 1;) {
26
if ((x=mbrtowc(&tmp,chptr,end-chptr,&ps))<=0)
33
if (spc && !iswspace(tmp))
35
else if (!spc && iswspace(tmp)) {
45
howbad += width - w2 + 1;
47
fprintf(stderr,"adding %d\n",width - w2 + 1, chptr);
49
if (spcptr) chptr = spcptr;
51
strncat(result, text, chptr - text );