- if (asprintf(&out_string, "%s%s", s, elt->add) < 0)
- return NULL;
+ item_str = ec_completed_item_get_str(item);
+ if (c->count_match == 1) {
+
+ /* don't add the trailing space for partial completions */
+ if (state == 0) {
+ item_type = ec_completed_item_get_type(item);
+ if (item_type == EC_MATCH)
+ rl_completion_suppress_append = 0;
+ else
+ rl_completion_suppress_append = 1;
+ }
+
+ return strdup(item_str);
+ } else if (rl_completion_type == '?') {
+ /* on second try only show the display part */
+ item_display = ec_completed_item_get_display(item);
+ return strdup(item_display);
+ }