Permalink
Browse files

Escape all cmd.exe reserved chars

  • Loading branch information...
1 parent ba6eb10 commit 63e689b64798b0d4cfdcfbea47570b6421b97abe @majutsushi committed Sep 11, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 autoload/tagbar.vim
View
@@ -3154,7 +3154,12 @@ function! s:EscapeCtagsCmd(ctags_bin, args, ...) abort
" Stupid cmd.exe quoting
if &shell =~ 'cmd\.exe'
- let ctags_cmd = substitute(ctags_cmd, '\(&\|\^\)', '^\0', 'g')
+ let reserved_chars = '&()@^'
+ " not allowed in filenames, but escape anyway just in case
+ let reserved_chars .= '<>|'
+ let pattern = join(split(reserved_chars, '\zs'), '\|')
+ let ctags_cmd = substitute(ctags_cmd, '\V\(' . pattern . '\)',
+ \ '^\0', 'g')
endif
if exists('+shellslash')

0 comments on commit 63e689b

Please sign in to comment.