Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59086 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94336 invoked from network); 20 Mar 2012 19:30:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Mar 2012 19:30:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=christopher.jones@oracle.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=christopher.jones@oracle.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain oracle.com from 148.87.113.117 cause and error) X-PHP-List-Original-Sender: christopher.jones@oracle.com X-Host-Fingerprint: 148.87.113.117 rcsinet15.oracle.com Received: from [148.87.113.117] ([148.87.113.117:17589] helo=rcsinet15.oracle.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 27/72-59347-BB7D86F4 for ; Tue, 20 Mar 2012 14:17:17 -0500 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q2KJHA1r011439 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 20 Mar 2012 19:17:11 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q2KJH9t0007054 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Mar 2012 19:17:10 GMT Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q2KJH93h021272; Tue, 20 Mar 2012 14:17:09 -0500 Received: from [130.35.70.154] (/130.35.70.154) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 20 Mar 2012 12:17:09 -0700 Message-ID: <4F68D7B4.4030305@oracle.com> Date: Tue, 20 Mar 2012 12:17:08 -0700 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0) Gecko/20120129 Thunderbird/10.0 MIME-Version: 1.0 To: Osama Abu Elsorour CC: internals@lists.php.net References: <11302143-55E0-48E9-AC30-943E6075E794@eformations.net> In-Reply-To: <11302143-55E0-48E9-AC30-943E6075E794@eformations.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-CT-RefId: str=0001.0A090209.4F68D7B7.0120,ss=1,re=0.000,fgs=0 Subject: Re: [PHP-DEV] [PATCH] readline extension bug fixes and enhancements From: christopher.jones@oracle.com (Christopher Jones) On 03/20/2012 12:06 PM, Osama Abu Elsorour wrote: > All, > > I was recently involved in a project that relied heavily on readline to provide console text input capabilities. However I soon noticed that the current readline extension has a serious bug and is lacking some important functionality. > > This patch applies only to PHP compiled with libreadline (and don't have an effect if compiled with libeditline). It adds/modifies/fixes the following: > - Fixes memory corruption caused by directly setting rl_line_buffer to new buffer and not using rl_replace_line(). > - Fixes a bad combination of preprocessor #if that would cause readline_on_new_line() implementation not to compile when using libreadline only. > - Adds support for rl_bind_key function by exposing: > function readline_bind_key_function($key, $callback_func) > where: > $key: Key code to bind to. > $callback_func: A callback function in the form: > function callback($key, $count) where $key and $count are the same parameters passed from rl_bind_key() > Setting $callback_func to null will cause the binding to be removed for $key. > - Modifies the behavior of readline_info() to allow for setting the readline properties "point" and "end" (it used to only read them but not set them). > > Patch below: To avoid your patch getting lost in the mail archives, what about trying out the new github integration?: https://wiki.php.net/vcs/gitworkflow#workflow_for_external_contributors Or log a bug (https://bugs.php.net/) and attach the patch. Chris -- Email: christopher.jones@oracle.com Tel: +1 650 506 8630 Blog: http://blogs.oracle.com/opal/