summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2016-09-22 14:42:50 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2016-09-23 06:29:59 +0000
commit0e01942c07f51f2eb9896625adfec246289851b8 (patch)
tree95ac246398c14874bd1a670c08fdae4709f6c213
parent7ecc3f8b4efe89ac539201ddfce087dca4ad77a9 (diff)
downloadzsh-0e01942c07f51f2eb9896625adfec246289851b8.tar.gz
zsh-0e01942c07f51f2eb9896625adfec246289851b8.tar.xz
zsh-0e01942c07f51f2eb9896625adfec246289851b8.zip
39412: Fix directory completion when $PWD:h contains parentheses, which are interpreted as globbing metacharacters.
-rw-r--r--ChangeLog6
-rw-r--r--Src/Zle/computil.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 260047969..608a296e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-09-23  Daniel Shahaf  <d.s@daniel.shahaf.name>
+
+	* 39412: Src/Zle/computil.c: Fix directory completion when
+	$PWD:h contains parentheses, which are interpreted as globbing
+	metacharacters.
+
 2016-09-22  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
 	* 39410: Completion/Darwin/Type/_retrieve_mac_apps,
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index 16b681cda..27b78cd61 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -4830,8 +4830,11 @@ cf_remove_other(char **names, char *pre, int *amb)
  *     3. compfiles -P  parnam1 parnam2 skipped matcher sdirs parnam3 
  *
  *     1. Set parnam1 to an array of patterns....
+ *        ${(P)parnam1} is an in/out parameter.
  *     2. Like #1 but without calling cfp_opt_pats().  (This is only used by _approximate.)
  *     3. Like #1 but varargs is implicitly set to  char *varargs[2] = { "*(-/)", NULL };.
+ *
+ *     parnam2 has to do with the accept-exact style (see cfp_test_exact()).
  */
 
 static int
@@ -4866,7 +4869,7 @@ bin_compfiles(char *nam, char **args, UNUSED(Options ops), UNUSED(int func))
 		return 0;
 	    }
 	    for (l = newlinklist(); *tmp; tmp++)
-		addlinknode(l, *tmp);
+		addlinknode(l, quotestring(*tmp, QT_BACKSLASH_PATTERN));
 	    set_list_array(args[1], cf_pats((args[0][1] == 'P'), !!args[0][2],
 					    l, getaparam(args[2]), args[3],
 					    args[4], args[5],