bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Possible bug with ncurses widec in form


From: Rafael
Subject: Possible bug with ncurses widec in form
Date: Thu, 03 Dec 2009 12:48:37 +0100
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706)

Hello,

We are having trouble reading in a form field with more than one row, this problem only happens with "ncurses wide. The problem is that only returns the contents of the first line of the form.

Looking at the code I've seen in "fld_def.c" with widec enabled that "working field" is defined as:

 newpad (1, Buffer_Length (New_Field) + 1)
 ie, rows="1"  and  columns="Buffer_Length (New_Field) + 1"

but in "frm_driver.c" uses:   newpad (field-> drow, field-> dcols)


I tried to change "set_field_buffer" in "frm_driver.c" and now it returns the contents of all rows.

diff -Naur ncurses-5.7-20091128/form/frm_driver.c ncurses-5.7-20091128.mod/form/frm_driver.c --- ncurses-5.7-20091128/form/frm_driver.c 2009-11-07 20:54:03.000000000 +0100 +++ ncurses-5.7-20091128.mod/form/frm_driver.c 2009-12-03 11:39:09.000000000 +0100
@@ -4430,11 +4430,11 @@
   * and other special cases that we really do not want to handle here.
   */
#if NCURSES_EXT_FUNCS
-  if (wresize(field->working, field->drows, field->dcols) == ERR)
+  if (wresize(field->working, 1, Buffer_Length( field) + 1) == ERR)
#endif
    {
      delwin(field->working);
-      field->working = newpad(field->drows, field->dcols);
+      field->working = newpad(1, Buffer_Length( field) + 1);
    }
  len = Buffer_Length(field);
  wclear(field->working);


Is this correct?


Regards

--
Rafael Garrido Fernandez
Dpto. de Informática
Tlf: +34 957-32-59-94
Fax: +34 957-32-59-98
Email: address@hidden
DEZA CALIDAD S.A





reply via email to

[Prev in Thread] Current Thread [Next in Thread]