Package: libncursesw5
Version: 5.5-1
Severity: normal
Tags: patch

The wins_nwstr() logic of inserting characters fails on the cyrillic
charcters, because they aren't 'wide' (wcwidth(char) == 1), but they
aren't ASCII chars, so _nc_insert_ch() function (called from the
wins_nwstr() in case of non-'wide' char) fails to put the correct
character in the window.

The bug was discovered by Ivan Loh (loh at 1917 dot com) by trying to
use aspell with russian texts.

Attached patch fixes the problem.

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12-1-686
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)

Versions of packages libncursesw5 depends on:
ii  libc6                         2.3.5-8    GNU C Library: Shared libraries an

Versions of packages libncursesw5 recommends:
ii  libgpmg1                      1.19.6-21  General Purpose Mouse - shared lib

-- no debconf information
diff -u ncurses-5.5/debian/changelog ncurses-5.5/debian/changelog
--- ncurses-5.5/debian/changelog
+++ ncurses-5.5/debian/changelog
@@ -1,3 +1,10 @@
+ncurses (5.5-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Trying to fix the bug in wins_nwstr.
+
+ -- Dmitry Baryshkov <[EMAIL PROTECTED]>  Thu,  1 Dec 2005 23:56:03 +0300
+
 ncurses (5.5-1) unstable; urgency=low
 
   * New upstream release.
only in patch2:
unchanged:
--- ncurses-5.5.orig/ncurses/widechar/lib_ins_wch.c
+++ ncurses-5.5/ncurses/widechar/lib_ins_wch.c
@@ -115,9 +115,11 @@
            oy = win->_cury;
            ox = win->_curx;
            for (cp = wstr; *cp && ((cp - wstr) < n); cp++) {
-               int len = wcwidth(*cp);
+//             int len = wcwidth(*cp);
 
-               if (len != 1) {
+//             if (len != 1)
+               if (*cp > 127)
+               {
                    cchar_t tmp_cchar;
                    wchar_t tmp_wchar = *cp;
                    memset(&tmp_cchar, 0, sizeof(tmp_cchar));

Reply via email to