Your message dated Wed, 26 Oct 2011 15:18:05 +0000 with message-id <[email protected]> and subject line Bug#603276: fixed in stfl 0.22-1 has caused the Debian Bug report #603276, regarding libstfl-dev: An input widget overflows if multi-column characters are entered. to be marked as done.
This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact [email protected] immediately.) -- 603276: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=603276 Debian Bug Tracking System Contact [email protected] with problems
--- Begin Message ---Package: libstfl-dev Version: 0.21-2+b1 Severity: normal Tags: patch If multi-column characters are entered to an input widget and they are exposed, the text overflows. The attached screenshot was taken while running attached input.c. -- System Information: Debian Release: squeeze/sid APT prefers unstable APT policy: (1001, 'unstable'), (500, 'unstable'), (1, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 2.6.37-rc1 (SMP w/4 CPU cores) Locale: LANG=ja_JP.eucJP, LC_CTYPE=ja_JP.eucJP (charmap=EUC-JP) Shell: /bin/sh linked to /bin/dash Versions of packages libstfl-dev depends on: ii libncursesw5-dev 5.7+20100313-4 developer's libraries for ncursesw libstfl-dev recommends no packages. libstfl-dev suggests no packages. -- no debconf information#include <stfl.h> #include <locale.h> int main(void) { struct stfl_form *form; const wchar_t *wcs; if (setlocale(LC_ALL, "") == NULL) { return 1; } form = stfl_create(L"table\n label .expand:0\n !input[i] .border:lrtb .expand:h pos[pos]: offset[off]:\n tablebr\n label .expand:0 text:width\n label .expand:h text[w]:\n tablebr\n label .expand:0 text:pos\n label .expand:h text[p]:\n tablebr\n label .expand:0 text:offset\n label .expand:h text[o]:"); stfl_run(form, -3); stfl_set(form, L"w", stfl_get(form, L"i:w")); wcs = stfl_get(form, L"pos"); stfl_set(form, L"p", wcscmp(wcs, L"")? wcs: L"0"); wcs = stfl_get(form, L"off"); stfl_set(form, L"o", wcscmp(wcs, L"")? wcs: L"0"); while (stfl_run(form, 0) == NULL) { stfl_set(form, L"label", stfl_get_focus(form)); wcs = stfl_get(form, L"pos"); stfl_set(form, L"p", wcscmp(wcs, L"")? wcs: L"0"); wcs = stfl_get(form, L"off"); stfl_set(form, L"o", wcscmp(wcs, L"")? wcs: L"0"); } stfl_reset(); stfl_free(form); return 0; }<<attachment: screenshot.png>>
--- stfl-0.21.orig/widgets/wt_input.c 2007-10-13 07:45:09.000000000 +0000 +++ stfl-0.21/widgets/wt_input.c 2010-11-12 10:21:29.645201794 +0000 @@ -38,32 +38,21 @@ const wchar_t* text = stfl_widget_getkv_str(w, L"text", L""); int text_len = wcslen(text); int changed = 0; - int pos_width = 0; - int offset_width = 0; - int i; + int width; if (pos > text_len) { pos = text_len; changed = 1; } - if (offset > text_len) { - offset = text_len; - changed = 1; - } - if (offset > pos) { offset = pos; changed = 1; } - for (i=0;i<pos;++i) { - pos_width += wcwidth(text[i]); - } - - while (text[offset] && pos-offset >= w->w && pos_width-offset_width >= w->w && w->w > 0) { - offset_width += wcwidth(text[offset]); - offset++; + width = wcswidth(text + offset, pos - offset); + while (width >= w->w && pos > offset) { + width -= wcwidth(text[offset++]); changed = 1; } @@ -88,26 +77,30 @@ int pos = stfl_widget_getkv_int(w, L"pos", 0); int blind = stfl_widget_getkv_int(w, L"blind", 0); int offset = stfl_widget_getkv_int(w, L"offset", 0); - const wchar_t *text = stfl_widget_getkv_str(w, L"text", L""); - int pos_width = 0, offset_width = 0, i; + const wchar_t * const text_off = stfl_widget_getkv_str(w, L"text", L"") + offset; + int i; stfl_widget_style(w, f, win); for (i=0; i<w->w; i++) mvwaddwstr(win, w->y, w->x+i, L" "); - if (!blind) - mvwaddnwstr(win, w->y, w->x, text+offset, wcswidth(text+offset,w->w)); - - for (i=0;i<pos;++i) { - pos_width += wcwidth(text[i]); - } - for (i=0;i<offset;++i) { - offset_width += wcwidth(text[i]); + if (!blind) { + const int off_len = wcslen(text_off); + int width, len; + + width = wcswidth(text_off, w->w); + if (w->w > off_len) + len = off_len; + else + len = w->w; + while (width > w->w) + width -= wcwidth(text_off[--len]); + mvwaddnwstr(win, w->y, w->x, text_off, len); } if (f->current_focus_id == w->id) { - f->cursor_x = w->x + pos_width - offset_width; + f->cursor_x = w->x + wcswidth(text_off, pos - offset); f->cursor_y = w->y; } } @@ -150,8 +143,7 @@ return 0; wchar_t newtext[text_len]; wmemcpy(newtext, text, pos); - wmemcpy(newtext+pos, text+pos+1, text_len-(pos+1)); - newtext[text_len-1] = 0; + wcscpy(newtext + pos, text + pos + 1); stfl_widget_setkv_str(w, L"text", newtext); fix_offset_pos(w); return 1; @@ -163,8 +155,7 @@ return 0; wchar_t newtext[text_len]; wmemcpy(newtext, text, pos-1); - wmemcpy(newtext+pos-1, text+pos, text_len-pos); - newtext[text_len-1] = 0; + wcscpy(newtext + pos - 1, text + pos); stfl_widget_setkv_str(w, L"text", newtext); stfl_widget_setkv_int(w, L"pos", pos-1); fix_offset_pos(w); @@ -176,8 +167,7 @@ wchar_t newtext[text_len + 2]; wmemcpy(newtext, text, pos); newtext[pos] = ch; - wmemcpy(newtext+pos+1, text+pos, text_len - pos); - newtext[text_len + 1] = 0; + wcscpy(newtext + pos + 1, text + pos); stfl_widget_setkv_str(w, L"text", newtext); stfl_widget_setkv_int(w, L"pos", pos+1); fix_offset_pos(w);
--- End Message ---
--- Begin Message ---Source: stfl Source-Version: 0.22-1 We believe that the bug you reported is fixed in the latest version of stfl, which is due to be installed in the Debian FTP archive: libstfl-dev_0.22-1_amd64.deb to main/s/stfl/libstfl-dev_0.22-1_amd64.deb libstfl-perl_0.22-1_amd64.deb to main/s/stfl/libstfl-perl_0.22-1_amd64.deb libstfl-ruby1.8_0.22-1_amd64.deb to main/s/stfl/libstfl-ruby1.8_0.22-1_amd64.deb libstfl-ruby1.9.1_0.22-1_amd64.deb to main/s/stfl/libstfl-ruby1.9.1_0.22-1_amd64.deb libstfl-ruby_0.22-1_all.deb to main/s/stfl/libstfl-ruby_0.22-1_all.deb libstfl-spl_0.22-1_amd64.deb to main/s/stfl/libstfl-spl_0.22-1_amd64.deb libstfl0_0.22-1_amd64.deb to main/s/stfl/libstfl0_0.22-1_amd64.deb python-stfl_0.22-1_amd64.deb to main/s/stfl/python-stfl_0.22-1_amd64.deb stfl_0.22-1.debian.tar.gz to main/s/stfl/stfl_0.22-1.debian.tar.gz stfl_0.22-1.dsc to main/s/stfl/stfl_0.22-1.dsc stfl_0.22.orig.tar.gz to main/s/stfl/stfl_0.22.orig.tar.gz A summary of the changes between this version and the previous one is attached. Thank you for reporting the bug, which will now be closed. If you have further comments please address them to [email protected], and the maintainer will reopen the bug report if appropriate. Debian distribution maintenance software pp. Nico Golde <[email protected]> (supplier of updated stfl package) (This message was generated automatically at their request; if you believe that there is a problem with it please contact the archive administrators by mailing [email protected]) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Format: 1.8 Date: Tue, 25 Oct 2011 16:01:40 +0200 Source: stfl Binary: libstfl0 libstfl-dev libstfl-perl python-stfl libstfl-ruby1.8 libstfl-ruby1.9.1 libstfl-ruby libstfl-spl Architecture: source amd64 all Version: 0.22-1 Distribution: unstable Urgency: low Maintainer: Nico Golde <[email protected]> Changed-By: Nico Golde <[email protected]> Description: libstfl-dev - development files for libstfl libstfl-perl - Perl bindings for the structured terminal forms language/library libstfl-ruby - Ruby bindings for the structured terminal forms language/library libstfl-ruby1.8 - Ruby 1.8 bindings for the structured terminal forms language/libr libstfl-ruby1.9.1 - Ruby 1.9.1 bindings for the structured terminal forms language/li libstfl-spl - SPL bindings for the structured terminal forms language/library libstfl0 - structured terminal forms language/library python-stfl - python bindings for the structured terminal forms language/librar Closes: 603276 603334 604770 617072 646199 646201 Changes: stfl (0.22-1) unstable; urgency=low . * New upstream version: - Fix widget overflows if multi-column characters are entered (Closes: #603276). - Fix that richtext is not multi-column caracters aware (Closes: #603334). - Fix that stfl_modify takes long time if a form has many widgets (Closes: #604770). * libstfl-dev: add missing strict dependency on libstfl0 (Closes: #646199). * libstfl0: do not depend on libncursesw5-dev (Closes: #646201). - Thanks Sven Joachim for both, this should've been noticed way earlier. * Convert package to dh_python2 (Closes: #617072). * Bump standards version, no changes needed. * Add ${misc:Depends} to binary packages where it was missing. * Switch to dpkg-source 3.0 (quilt) format. * Bump minor version in symbol files and link file. Checksums-Sha1: 6efe79cba51044a2442189d3d9c65af3d0f838b0 1608 stfl_0.22-1.dsc 226488be2b33867dfb233f0fa2dde2d066e494bd 41412 stfl_0.22.orig.tar.gz 62a6388c6efa7dd2c49e11a422d6adb4842da11f 9223 stfl_0.22-1.debian.tar.gz 68cb99e6e1870a223b3fb0b215aca5d6a9d25541 41546 libstfl0_0.22-1_amd64.deb 038df223fe35d49554572b5b1e94c0322cd23570 39736 libstfl-dev_0.22-1_amd64.deb 91ee9e9625623fe68f5ed6c56f4cd772f03eb521 47420 libstfl-perl_0.22-1_amd64.deb fcd8f9a36f535ae9df9873be15e5c807c961771e 95034 python-stfl_0.22-1_amd64.deb d2865d9f59d62f2bcbac55ed29427083d44be67d 45054 libstfl-ruby1.8_0.22-1_amd64.deb bd112e5d426606191aba3d2ee5912776abf0ff41 45236 libstfl-ruby1.9.1_0.22-1_amd64.deb f4217fb225e0cc3909ba9e0a4e84e2e86fada143 6466 libstfl-ruby_0.22-1_all.deb 3e816ef0a49ccb070d09f3bebcefa74bef281f61 33954 libstfl-spl_0.22-1_amd64.deb Checksums-Sha256: d9ba39e6a075edb4533b47846c39e89b094516d8a6122cd4745ce5985d222997 1608 stfl_0.22-1.dsc 2dddafd331e61ad04baf1251ccecb3a69feaf99880dd75155be8423c1cc55418 41412 stfl_0.22.orig.tar.gz ac5fed01c9c5bded6fecdd9f4ada546c686a8b65958fde48411877fdfc744718 9223 stfl_0.22-1.debian.tar.gz 78efd3fec568570ceb8848110af81f6e5e73e0894d9a5244c85f81293290b7de 41546 libstfl0_0.22-1_amd64.deb 1f3c6f1531852209eb53f4c627f564a7d4eba56499d6ee46676d89181cb9a8a1 39736 libstfl-dev_0.22-1_amd64.deb 33b7a9fcf87e42ebd8fd7af8c10ae06e8357045f2e2cda9524fbcbc8d4f2fbfe 47420 libstfl-perl_0.22-1_amd64.deb 3fa7c9cdd5909a33f8b750c3f0e38bc5a165dfcba0edf9c180c7a9e68e21fed0 95034 python-stfl_0.22-1_amd64.deb fedd29135771a4299f6bf8abafdb776e760d8a551b0ded390df2c80ec3383db8 45054 libstfl-ruby1.8_0.22-1_amd64.deb 87120763ed770a600aedd775bfe1fb772d487b08ae082544cb84cb384b461169 45236 libstfl-ruby1.9.1_0.22-1_amd64.deb e6c39621a25be03775eca3d77d905fba8fec28669a01568a32a5c30ac0073718 6466 libstfl-ruby_0.22-1_all.deb db038ab21970019a288b214eef116c6e5fd2f752a831b86210f816bef599d786 33954 libstfl-spl_0.22-1_amd64.deb Files: ab4792b668a2d68b44e6393f7fd592d1 1608 libdevel optional stfl_0.22-1.dsc df4998f69fed15fabd702a25777f74ab 41412 libdevel optional stfl_0.22.orig.tar.gz dde69246724282c724465630d7ea3121 9223 libdevel optional stfl_0.22-1.debian.tar.gz fef9df2c08c8bce7446cc3c0eaa493b9 41546 libs optional libstfl0_0.22-1_amd64.deb b270a7167b81f5de679bb484a4ad7dfe 39736 libdevel optional libstfl-dev_0.22-1_amd64.deb a3aa4944e21510d18df96205db4f7ffb 47420 perl optional libstfl-perl_0.22-1_amd64.deb a80c5e8718a7f2ee17becc1b83cc96de 95034 python optional python-stfl_0.22-1_amd64.deb e9f38c2bf15106c4bb28d26b0abf9473 45054 ruby optional libstfl-ruby1.8_0.22-1_amd64.deb 93e550e86ff0b45757522a8cd693c89c 45236 ruby optional libstfl-ruby1.9.1_0.22-1_amd64.deb 79bb463bf3d61fc37de514935cde3a8b 6466 ruby optional libstfl-ruby_0.22-1_all.deb 71cbe60cd8a14be797bfcc3eed100551 33954 devel optional libstfl-spl_0.22-1_amd64.deb -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk6mx7AACgkQHYflSXNkfP8afACeJkiP0t1ZC/vYO07JXMS6N0pJ e9cAn2svFn3Vqs70unUHUtgZi5oPRc32 =1lSu -----END PGP SIGNATURE-----
--- End Message ---

