clone 392942 -1 reassing -1 slang2 block 392942 by -1 thanks This is cleany bug in slang2.
slsmg.c contains:
void SLsmg_write_nstring (char *str, unsigned int n)
{
...
if (UTF8_Mode)
umax = SLutf8_skip_chars (u, u+width, n, &width, 0);
...
SLsmg_write_chars (u, umax);
}
while (width++ < n) SLsmg_write_chars (blank, blank+1);
}
from last line: 'n' is string width.
Let's look at SLutf8_skip_chars, in slutf8.c:
SLuchar_Type *SLutf8_skip_chars (SLuchar_Type *s, SLuchar_Type *smax,
unsigned int num, unsigned int *dnum,
int ignore_combining)
{
unsigned int n;
n = 0;
while ((n < num) && (s < smax))
{
...
/* here code that modifies n always adds 1, nothing depends on
* character width */
...
So here num, aka n in previous function, is used as number of
characters and not as string width.
/me dreams about time when slang's upstrem mainainers enlighten
themself by existance of wc* and mb* functions.
14 жовтня 2006 о 14:28 +0200 eugen написав(-ла):
> This bug is really related to #384787, in sence that something was
> change in newt, or more likely - in slang. It looks like functions
> SLsmg_write_string and SLsmg_write_nstring now work incorrecly. This bug
> can be seen without d-i by using the following scripts:
>
> whiptail --menu test 20 50 3 1 日本語 2 English 3 Українська\ мова
>
> And for bug similar to #384787 but with CJK:
>
> whiptail --inputbox test 20 50 日本語
>
> 14 жовтня 2006 о 13:49 +0200 Frans Pop написав(-ла):
> > I just noticed an important issue in newt that shows up in daily builds of
> > the installer. For languages (CJK) using double width characters,
> > calculation of line length is incorrect. It only affects a few languages,
> > but unfortunately affects them in a bad way.
> >
> > These screenshots show the issue:
> > http://people.debian.org/~fjp/d-i/d-i_newt_regression.png
> > http://people.debian.org/~fjp/d-i/d-i_newt_regression2.png
> >
> > I'm very sorry that I missed this when testing the fixed input box
> > handling (which really is fixed).
> >
>
>
> --
> Eugeniy Meshcheryakov
--
Eugeniy Meshcheryakov
signature.asc
Description: Digital signature

