php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #61584
Patch line_buffer-fix-end-point-set revision 2012-03-31 19:57 UTC by osama dot sorour at eformations dot net

Patch line_buffer-fix-end-point-set for Readline related Bug #61584

Patch version 2012-03-31 19:57 UTC

Return to Bug #61584 | Download this patch
Patch Revisions:

Developer: osama.sorour@eformations.net

--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -265,12 +265,20 @@ PHP_FUNCTION(readline_info)
                        if (value) {
                                /* XXX if (rl_line_buffer) free(rl_line_buffer); */
                                convert_to_string_ex(value);
-                               rl_line_buffer = strdup(Z_STRVAL_PP(value));
+                               rl_replace_line(Z_STRVAL_PP(value), 1);
                        }
                        RETVAL_STRING(SAFE_STRING(oldstr),1);
                } else if (!strcasecmp(what, "point")) {
+                       if (value) {
+                               convert_to_long_ex(value);
+                               rl_point = Z_LVAL_PP(value);
+                       }
                        RETVAL_LONG(rl_point);
                } else if (!strcasecmp(what, "end")) {
+                       if (value) {
+                               convert_to_long_ex(value);
+                               rl_end = Z_LVAL_PP(value);
+                       }
                        RETVAL_LONG(rl_end);
 #ifdef HAVE_LIBREADLINE
                } else if (!strcasecmp(what, "mark")) {
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Jan 26 20:01:25 2020 UTC