iliaa Thu Feb 3 19:21:50 2005 EDT
Modified files:
/php-src/ext/readline readline.c
Log:
Proper fix for bug #31796 .
http://cvs.php.net/diff.php/php-src/ext/readline/readline.c?r1=1.39&r2=1.40&ty=u
Index: php-src/ext/readline/readline.c
diff -u php-src/ext/readline/readline.c:1.39
php-src/ext/readline/readline.c:1.40
--- php-src/ext/readline/readline.c:1.39 Thu Feb 3 17:45:36 2005
+++ php-src/ext/readline/readline.c Thu Feb 3 19:21:50 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: readline.c,v 1.39 2005/02/03 22:45:36 iliaa Exp $ */
+/* $Id: readline.c,v 1.40 2005/02/04 00:21:50 iliaa Exp $ */
/* {{{ includes & prototypes */
@@ -377,7 +377,7 @@
}
}
- return strdup("");
+ return NULL;
}
static zval *_readline_string_zval(const char *str)
@@ -420,7 +420,13 @@
if (call_user_function(CG(function_table), NULL, _readline_completion,
&_readline_array, 3, params TSRMLS_CC) == SUCCESS) {
if (Z_TYPE(_readline_array) == IS_ARRAY) {
- matches =
completion_matches(text,_readline_command_generator);
+ if (zend_hash_num_elements(Z_ARRVAL(_readline_array))) {
+ matches =
completion_matches(text,_readline_command_generator);
+ } else {
+ matches = malloc(sizeof(char *) * 2);
+ matches[0] = strdup("");
+ matches[1] = '\0';
+ }
}
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php