Curses::getstr and Window#getstr use getnstr() and wgetnstr()
if they are available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e9abbf6a42
commit
6228c04396
@ -7,10 +7,10 @@
|
|||||||
* modified by Yukihiro Matsumoto (matz@netlab.co.jp),
|
* modified by Yukihiro Matsumoto (matz@netlab.co.jp),
|
||||||
* Toki Yoshinori,
|
* Toki Yoshinori,
|
||||||
* Hitoshi Takahashi,
|
* Hitoshi Takahashi,
|
||||||
* and Takaaki Tateishi (ttate@jaist.ac.jp)
|
* and Takaaki Tateishi (ttate@kt.jaist.ac.jp)
|
||||||
*
|
*
|
||||||
* maintainers:
|
* maintainers:
|
||||||
* - Takaaki Tateishi (ttate@jaist.ac.jp)
|
* - Takaaki Tateishi (ttate@kt.jaist.ac.jp)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_NCURSES_H
|
#ifdef HAVE_NCURSES_H
|
||||||
@ -396,7 +396,11 @@ curses_getstr(obj)
|
|||||||
char rtn[1024]; /* This should be big enough.. I hope */
|
char rtn[1024]; /* This should be big enough.. I hope */
|
||||||
|
|
||||||
rb_read_check(stdin);
|
rb_read_check(stdin);
|
||||||
|
#ifdef GETNSTR
|
||||||
|
getnstr(rtn,1023);
|
||||||
|
#else
|
||||||
getstr(rtn);
|
getstr(rtn);
|
||||||
|
#endif
|
||||||
return rb_tainted_str_new2(rtn);
|
return rb_tainted_str_new2(rtn);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1020,7 +1024,11 @@ window_getstr(obj)
|
|||||||
|
|
||||||
GetWINDOW(obj, winp);
|
GetWINDOW(obj, winp);
|
||||||
rb_read_check(stdin);
|
rb_read_check(stdin);
|
||||||
|
#ifdef WGETNSTR
|
||||||
|
wgetnstr(winp->window, rtn, 1023);
|
||||||
|
#else
|
||||||
wgetstr(winp->window, rtn);
|
wgetstr(winp->window, rtn);
|
||||||
|
#endif
|
||||||
return rb_tainted_str_new2(rtn);
|
return rb_tainted_str_new2(rtn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ else
|
|||||||
end
|
end
|
||||||
|
|
||||||
if make
|
if make
|
||||||
for f in %w(isendwin ungetch beep doupdate flash deleteln wdeleteln keypad keyname init_color)
|
for f in %w(isendwin ungetch beep getnstr wgetnstr doupdate flash deleteln wdeleteln keypad keyname init_color)
|
||||||
have_func(f)
|
have_func(f)
|
||||||
end
|
end
|
||||||
create_makefile("curses")
|
create_makefile("curses")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user