diff options
author | Moriyoshi Koizumi <moriyoshi@php.net> | 2002-12-22 19:01:44 +0000 |
---|---|---|
committer | Moriyoshi Koizumi <moriyoshi@php.net> | 2002-12-22 19:01:44 +0000 |
commit | dcc030f5ef63b28dbeef060a35b015e1968b0873 (patch) | |
tree | 6b1e89e2cc23c5630161f4f896c2df5cf6eee77a /ext/ncurses/ncurses_functions.c | |
parent | c5091eedf10cfbc66dab9b2d81e99bd474808297 (diff) | |
download | php-git-dcc030f5ef63b28dbeef060a35b015e1968b0873.tar.gz |
Fixed bug #21144
Diffstat (limited to 'ext/ncurses/ncurses_functions.c')
-rw-r--r-- | ext/ncurses/ncurses_functions.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/ncurses/ncurses_functions.c b/ext/ncurses/ncurses_functions.c index 61c99a25e2..fa3aa7c146 100644 --- a/ext/ncurses/ncurses_functions.c +++ b/ext/ncurses/ncurses_functions.c @@ -131,6 +131,8 @@ PHP_FUNCTION(ncurses_init) (void) nonl(); /* tell curses not to do NL->CR/NL on output */ (void) cbreak(); /* take input chars one at a time, no wait for \n */ + NCURSES_G(is_initialised) = 1; + if (!NCURSES_G(registered_constants)) { zend_constant c; @@ -315,7 +317,12 @@ PHP_FUNCTION(ncurses_refresh) Starts using colors */ PHP_FUNCTION(ncurses_start_color) { - RETURN_LONG(start_color()); + if (NCURSES_G(is_initialised)) { + RETURN_LONG(start_color()); + } else { + php_error(E_WARNING, "ncurses library is not initialised by ncurses_init()."); + RETURN_FALSE; + } } /* }}} */ |