summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/curses/curses.c16
2 files changed, 15 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 6f55ba7fdd..258cc2b659 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Dec 13 02:45:51 2004 Shugo Maeda <shugo@ruby-lang.org>
+
+ * ext/curses/curses.c (window_subwin): call NUM2INT() before
+ GetWINDOW(). fixed: [ruby-dev:25161]
+
Mon Dec 13 00:58:02 2004 Tanaka Akira <akr@m17n.org>
* lib/pathname.rb (cleanpath_aggressive): make it private.
diff --git a/ext/curses/curses.c b/ext/curses/curses.c
index 0408fbd6bc..a8952bf186 100644
--- a/ext/curses/curses.c
+++ b/ext/curses/curses.c
@@ -766,22 +766,26 @@ window_initialize(obj, h, w, top, left)
return obj;
}
-/* def subwin(h, w, top, left) */
+/* def subwin(height, width, top, left) */
static VALUE
-window_subwin(obj, h, w, top, left)
+window_subwin(obj, height, width, top, left)
VALUE obj;
- VALUE h;
- VALUE w;
+ VALUE height;
+ VALUE width;
VALUE top;
VALUE left;
{
struct windata *winp;
WINDOW *window;
VALUE win;
+ int h, w, t, l;
+ h = NUM2INT(height);
+ w = NUM2INT(width);
+ t = NUM2INT(top);
+ l = NUM2INT(left);
GetWINDOW(obj, winp);
- window = subwin(winp->window, NUM2INT(h), NUM2INT(w),
- NUM2INT(top), NUM2INT(left));
+ window = subwin(winp->window, h, w, t, l);
win = prep_window(rb_obj_class(obj), window);
return win;