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")) {
|