summaryrefslogtreecommitdiff
path: root/ext/readline/readline.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/readline/readline.c')
-rw-r--r--ext/readline/readline.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index b66928ebd6..9c018bf9c8 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -279,7 +279,9 @@ PHP_FUNCTION(readline_info)
oldstr = rl_line_buffer;
if (value) {
/* XXX if (rl_line_buffer) free(rl_line_buffer); */
- convert_to_string_ex(value);
+ if (!try_convert_to_string(value)) {
+ return;
+ }
rl_line_buffer = strdup(Z_STRVAL_P(value));
}
RETVAL_STRING(SAFE_STRING(oldstr));
@@ -302,7 +304,9 @@ PHP_FUNCTION(readline_info)
} else if (!strcasecmp(what, "pending_input")) {
oldval = rl_pending_input;
if (value) {
- convert_to_string_ex(value);
+ if (!try_convert_to_string(value)) {
+ return;
+ }
rl_pending_input = Z_STRVAL_P(value)[0];
}
RETVAL_LONG(oldval);
@@ -319,7 +323,9 @@ PHP_FUNCTION(readline_info)
} else if (!strcasecmp(what, "completion_append_character")) {
oldval = rl_completion_append_character;
if (value) {
- convert_to_string_ex(value)
+ if (!try_convert_to_string(value)) {
+ return;
+ }
rl_completion_append_character = (int)Z_STRVAL_P(value)[0];
}
RETVAL_INTERNED_STR(
@@ -342,7 +348,9 @@ PHP_FUNCTION(readline_info)
oldstr = (char*)rl_readline_name;
if (value) {
/* XXX if (rl_readline_name) free(rl_readline_name); */
- convert_to_string_ex(value);
+ if (!try_convert_to_string(value)) {
+ return;
+ }
rl_readline_name = strdup(Z_STRVAL_P(value));
}
RETVAL_STRING(SAFE_STRING(oldstr));