From: Operating system: Linux PHP version: 5.3.9 Package: ncurses related Bug Type: Bug Bug description:Missing NCURSES_KEY_HOME constant
Description: ------------ The PECL ncurses extension has a regression: the NCURSES_KEY_HOME constant is not defined when the extension is loaded. How on earth did this happen?? The first clue I had something was amiss with the ncurses codebase showed up in a diff between the PHP 5.2.17 tarball with the ncurses extension incorporated and the PECL 1.0.0 tarball: the ncurses files had 2010 as the copyright year; the PECL sources had 2006. The key difference is in ncurses.c, in which the list of constant-initializing macros is rearranged. The PECL version lacks a PHP_NCURSES_CONST(KEY_HOME) line. A look through the history is a bit more disturbing. The oldest PHP tarball I could find--for version 5.1.4--has ZERO code difference from PECL ncurses 1.0.0. Maintenance of the ncurses code did proceed since 2006, especially in the rearrangement of the constants in ncurses.c that resulted in adding the missing NCURSES_KEY_HOME constant. How many other regressions happened because you went back to an old version of the ncurses code? I noted a regression at line 1475 of ncurses_functions.c that you repaired by version 1.0.1. The other regressions seem more benign: the call to DISPLAY_INI_ENTRIES() in the PHP_MINFO_FUNCTION() at line 277 of ncurses.c has nothing to display because there are no .ini entries for the extension, and line 35 of ncurses_functions.c has a spelling error (ncruses instead of ncurses). I tried looked at the Subversion repository, but after letting the checkout run for several hours it was still running. I've given you a patch for that you can apply. I added that patch to the Gentoo ebuild I made for dev-php5/pecl-ncurses-1.0.0, rebuilt it, and saw that it worked. I'm hoping the fix makes it out to Debian to get into Squeeze (and PHP 5.3) by the time we move to Squeeze at work. Test script: --------------- <?php if (defined('NCURSES_KEY_END')) { if (defined('NCURSES_KEY_HOME')) { echo "PHP has ncurses with definitions for the Home and End keys\n"; } else { echo "Oops: ncurses extension lacks Home key!!\n"; } } else { echo "It looks like the ncurses extension is not enabled\n"; } Expected result: ---------------- PHP has ncurses with definitions for the Home and End keys Actual result: -------------- Oops: ncurses extension lacks Home key!! -- Edit bug report at https://bugs.php.net/bug.php?id=60853&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60853&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60853&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60853&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60853&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60853&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60853&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60853&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60853&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60853&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60853&r=support Expected behavior: https://bugs.php.net/fix.php?id=60853&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60853&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60853&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60853&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60853&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=60853&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60853&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60853&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60853&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60853&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60853&r=mysqlcfg