diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-03-06 10:07:53 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-03-06 10:07:53 +0000 |
commit | 6a3fdf70f18a7b67808f23ddbd28e9631f7f905a (patch) | |
tree | 3007e2a4a9ffc83b1a6e73753c083c5ff800bf09 /ext/curses | |
parent | f70ffbee2120cbbb8c6b0a15dfc693a69ac0d7d4 (diff) |
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/curses')
-rw-r--r-- | ext/curses/curses.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/ext/curses/curses.c b/ext/curses/curses.c index 0230636c50..127f51a0cb 100644 --- a/ext/curses/curses.c +++ b/ext/curses/curses.c @@ -99,15 +99,27 @@ curses_stdscr() static VALUE curses_close_screen() { - endwin(); +#ifdef HAVE_ISENDWIN + if (!isendwin()) +#endif + endwin(); return Qnil; } +static void +curses_finalize() +{ +#ifdef HAVE_ISENDWIN + if (!isendwin()) +#endif + endwin(); +} + /* def closed? */ static VALUE curses_closed() { -#ifdef HAVE_ENDWIN +#ifdef HAVE_ISENDWIN if (isendwin()) { return TRUE; } @@ -313,7 +325,7 @@ curses_addstr(obj, str) VALUE obj; VALUE str; { - addstr(RSTRING(str)->ptr); + addstr(STR2CSTR(str)); return Qnil; } @@ -659,7 +671,7 @@ window_addstr(obj, str) struct windata *winp; GetWINDOW(obj, winp); - waddstr(winp->window, RSTRING(str)->ptr); + waddstr(winp->window, STR2CSTR(str)); return Qnil; } @@ -787,4 +799,6 @@ Init_curses() rb_define_method(cWindow, "getstr", window_getstr, 0); rb_define_method(cWindow, "delch", window_delch, 0); rb_define_method(cWindow, "deleteln", window_deleteln, 0); + + rb_set_end_proc(curses_finalize, 0); } |