|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesrestore_homekey.diff (last revision 2012-01-23 15:39 UTC by mbt at gator dot net)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-01-24 14:52 UTC] mbt at gator dot net
-Package: ncurses related
+Package: ncurses
[2012-01-24 14:52 UTC] mbt at gator dot net
[2012-01-28 02:34 UTC] rasmus@php.net
[2012-01-28 02:35 UTC] rasmus@php.net
[2012-01-28 02:35 UTC] rasmus@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: rasmus
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 19:00:01 2025 UTC |
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!!