about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Completion/Core/_path_files7
-rw-r--r--Src/Zle/zle_tricky.c5
2 files changed, 9 insertions, 3 deletions
diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files
index 6e23f46aa..4bdde4d20 100644
--- a/Completion/Core/_path_files
+++ b/Completion/Core/_path_files
@@ -277,7 +277,12 @@ for prepath in "$prepaths[@]"; do
       # otherwise this would keep `_files' from completing all filenames
       # if none of the patterns match.
 
-      if [[ "$haspats" = no && -z "$tpre$tsuf" &&
+      if [[ -z "$tpre$tsuf" ]]; then
+        tmp1=( "$tmp2[@]" )
+	addsfx=(-S '')
+	remsfx=()
+	break;
+      elif [[ "$haspats" = no && -z "$tpre$tsuf" &&
 	"$pre" = */ && -z "$suf" ]]; then
 	PREFIX="${opre}${osuf}"
 	SUFFIX=""
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 84f61e002..85e592045 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -7835,7 +7835,7 @@ cut_cline(Cline l)
 	    q = p;
     }
     if (!e && q && !q->orig && !q->olen && (q->flags & CLF_MISS) &&
-	(q->word ? q->wlen : q->llen) < 3) {
+	!(q->flags & CLF_MATCHED) && (q->word ? q->wlen : q->llen) < 3) {
 	q->word = q->line = NULL;
 	q->wlen = q->llen = 0;
     }
@@ -8452,7 +8452,8 @@ do_single(Cmatch m)
 	    if (m->flags & CMF_PARNEST)
 		havesuff = 1;
 	}
-	if ((m->flags & CMF_FILE) || (partest && isset(AUTOPARAMSLASH))) {
+	if (((m->flags & CMF_FILE) || (partest && isset(AUTOPARAMSLASH))) &&
+	    cs > 0 && line[cs - 1] != '/') {
 	    /* If we have a filename or we completed a parameter name      *
 	     * and AUTO_PARAM_SLASH is set, lets see if it is a directory. *
 	     * If it is, we append a slash.                                */