Package: vim
Version: 2:7.2.245-2
Severity: normal
Tags: patch
--- Please enter the report below this line. ---
Hi,
To reproduce the bug. Just create a directory with a ~ (mkdir
-p /tmp/bad~dir). Then when you do a :chdir /tmp/bad~dir, an error
is raised E79: Cannot expand wildcards.
As a side effect it is not possible to use a tags file in the bad~dir
or below (/tmp/bad~dir/tags) because it will no be seen by vim.
Note I have not tested all shell but the bug appears with the tsch
shell (and not zsh for example). So you must use this option set
shell=/bin/tcsh\ -f.
Please find attached a patch that seems solve the problem not sure it
is the good solution (and works in all situations). Maybe a solution
will be to escaped ~ like '\~' before sending to the tcsh shell.
Note: Tcsh debian version is 6.14.00-7
Best Regards,
Gregory
--- System information. ---
Architecture: i386
Kernel: Linux 2.6.30.3-ghost
Debian Release: squeeze/sid
500 unstableftp.fr.debian.org
1 experimentalftp.fr.debian.org
--- Package information. ---
Depends (Version) | Installed
===-+-
vim-common(= 2:7.2.245-2) | 2:7.2.245-2
vim-runtime (= 2:7.2.245-2) | 2:7.2.245-2
libacl1 (= 2.2.11-1) | 2.2.47-3
libc6(= 2.3.4) | 2.9-25
libgpm2 (= 1.20.4) | 1.20.4-3.2
libncurses5 (= 5.6+20071006-3) | 5.7+20090803-1+b1
libselinux1 (= 2.0.85) | 2.0.85-1
Package's Recommends field is empty.
Suggests (Version) | Installed
==-+-===
ctags |
vim-doc|
vim-scripts| 20090211-1
--- misc1.c 2009-08-19 12:24:24.0 +0200
+++ vim-7.2.245/src/misc1.c 2009-08-19 12:26:03.0 +0200
@@ -9199,8 +9199,9 @@ gen_expand_wildcards(num_pat, pat, num_f
{
/*
* First expand environment variables, ~/ and ~user/.
+ * Only expand ~ when it is a first caracter
*/
- if (vim_strpbrk(p, (char_u *)$~) != NULL)
+ if (vim_strpbrk(p, (char_u *)$) != NULL || p[0] == '~')
{
p = expand_env_save_opt(p, TRUE);
if (p == NULL)
@@ -9211,7 +9212,7 @@ gen_expand_wildcards(num_pat, pat, num_f
* variable, use the shell to do that. Discard previously
* found file names and start all over again.
*/
- else if (vim_strpbrk(p, (char_u *)$~) != NULL)
+ else if (vim_strpbrk(p, (char_u *)$) != NULL || p[0] == '~')
{
vim_free(p);
ga_clear_strings(ga);