diff --git a/contrib/libedit/filecomplete.c b/contrib/libedit/filecomplete.c index 6dc7cff1d05..e20f8bd1bed 100644 --- a/contrib/libedit/filecomplete.c +++ b/contrib/libedit/filecomplete.c @@ -710,6 +710,13 @@ fn_complete2(EditLine *el, *over = 0; if (matches == NULL) { + const char *line = ct_encode_string(temp, &el->el_scratch); + const char *last = strrchr(line, '/'); + last = last == NULL ? line : last + 1; + if (strcmp(last, ".") == 0 || strcmp(last, "..") == 0) { + el_winsertstr(el, ct_decode_string( + (*app_func)(line), &el->el_scratch)); + } goto out; } int i;