[Python-checkins] CVS: python/dist/src/Modules _cursesmodule.c,2.52,2.53
A.M. Kuchling
akuchling@users.sourceforge.net
Sat, 14 Jul 2001 13:38:32 -0700
Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv13810
Modified Files:
_cursesmodule.c
Log Message:
Fix bug #417212: "curses.newwin can return pads" by changing the Python
newwin() wrapper to always return a window, and never a pad. This makes
the code match the documentation.
Index: _cursesmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_cursesmodule.c,v
retrieving revision 2.52
retrieving revision 2.53
diff -C2 -r2.52 -r2.53
*** _cursesmodule.c 2001/06/23 19:58:46 2.52
--- _cursesmodule.c 2001/07/14 20:38:30 2.53
***************
*** 2052,2056 ****
{
WINDOW *win;
! int nlines, ncols, begin_y, begin_x;
PyCursesInitialised
--- 2052,2056 ----
{
WINDOW *win;
! int nlines, ncols, begin_y=0, begin_x=0;
PyCursesInitialised
***************
*** 2060,2064 ****
if (!PyArg_Parse(args,"(ii);nlines,ncols",&nlines,&ncols))
return NULL;
- win = newpad(nlines, ncols);
break;
case 4:
--- 2060,2063 ----
***************
*** 2066,2070 ****
&nlines,&ncols,&begin_y,&begin_x))
return NULL;
- win = newwin(nlines,ncols,begin_y,begin_x);
break;
default:
--- 2065,2068 ----
***************
*** 2073,2076 ****
--- 2071,2075 ----
}
+ win = newwin(nlines,ncols,begin_y,begin_x);
if (win == NULL) {
PyErr_SetString(PyCursesError, catchall_NULL);