}
}
- return strdup("");
+ return NULL;
}
static zval *_readline_string_zval(const char *str)
if (call_user_function(CG(function_table), NULL, params[0], &_readline_array, 3, params+1 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';
+ }
}
}