slang-users mailing list

[2006 Date Index] [2006 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [slang-users] Bug in SLutf8_skip_chars?


=?UTF-8?Q?J=C3=B6rg?= Sommer <joerg@xxxxxxxxxxxx> wrote:
>the Debian maintainer of libslang2 added a patch to the newest version
>2.0.6-4 that fixes a bug in SLutf8_skip_chars().
>http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=392942 But this bug
>breaks jed. Now, the question is, what's the right return value of
>SLutf8_skip_chars?
[...]
>% dpkg -l libslang2
>ii  libslang2      2.0.6-3        The S-Lang programming library - runtime ver
>% ./test
>1
>% dpkg -l libslang2
>ii  libslang2      2.0.6-4        The S-Lang programming library - runtime ver
>% ./test
>0

The correct return value is 1.  The code was designed to work with
malformed UTF-8 sequences.  In general, an N byte sequence contains U
valid UTF-8 encoded characters and B invalid bytes, where

   N > U + B

The function returns U+B via the parameter list.  Note that for a
completely valid UTF-8 byte-sequence, B will be 0 and the function
will behave the same as the debian patched version.  So, it seems to
me that the problem is that the application (whiptail in this case) is
using this function incorrectly.  If either SLsmg_write_nstring or
SLsmg_write_string is doing something wrong, then I will make every
effort to correct the problem.  But as far as SLutf8_skip_chars goes,
it is ok and should not have been patched.

Thanks,
--John


_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html


[2006 date index] [2006 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]