Merge pull request #13 from junegunn/shellesc
Replace shellescape function to avoid error when &shellslash is set
This commit is contained in:
		
						commit
						c827d2fa05
					
				
							
								
								
									
										13
									
								
								plug.vim
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								plug.vim
									
									
									
									
									
								
							|  | @ -376,10 +376,11 @@ function! s:update_serial(pull) | ||||||
|           call mkdir(base, 'p') |           call mkdir(base, 'p') | ||||||
|         endif |         endif | ||||||
|         execute 'cd '.base |         execute 'cd '.base | ||||||
|         let d = shellescape(substitute(spec.dir, '[\/]\+$', '', '')) |  | ||||||
|         let result = s:system( |         let result = s:system( | ||||||
|               \ printf('git clone --recursive %s -b %s %s 2>&1', |               \ printf('git clone --recursive %s -b %s %s 2>&1', | ||||||
|               \ shellescape(spec.uri), shellescape(spec.branch), d)) |               \ s:shellesc(spec.uri), | ||||||
|  |               \ s:shellesc(spec.branch), | ||||||
|  |               \ s:shellesc(substitute(spec.dir, '[\/]\+$', '', '')))) | ||||||
|         let error = v:shell_error != 0 |         let error = v:shell_error != 0 | ||||||
|       endif |       endif | ||||||
|       cd - |       cd - | ||||||
|  | @ -557,6 +558,10 @@ function! s:dirpath(path) | ||||||
|   endif |   endif | ||||||
| endfunction | endfunction | ||||||
| 
 | 
 | ||||||
|  | function! s:shellesc(arg) | ||||||
|  |   return '"'.substitute(a:arg, '"', '\\"', 'g').'"' | ||||||
|  | endfunction | ||||||
|  | 
 | ||||||
| function! s:glob_dir(path) | function! s:glob_dir(path) | ||||||
|   return map(filter(split(globpath(a:path, '**'), '\n'), 'isdirectory(v:val)'), 's:dirpath(v:val)') |   return map(filter(split(globpath(a:path, '**'), '\n'), 'isdirectory(v:val)'), 's:dirpath(v:val)') | ||||||
| endfunction | endfunction | ||||||
|  | @ -674,8 +679,8 @@ endfunction | ||||||
| 
 | 
 | ||||||
| function! s:upgrade() | function! s:upgrade() | ||||||
|   if executable('curl') |   if executable('curl') | ||||||
|     let mee = shellescape(s:me) |     let mee = s:shellesc(s:me) | ||||||
|     let new = shellescape(s:me . '.new') |     let new = s:shellesc(s:me . '.new') | ||||||
|     echo "Downloading ". s:plug_source |     echo "Downloading ". s:plug_source | ||||||
|     redraw |     redraw | ||||||
|     let mv = s:is_win ? 'move /Y' : 'mv -f' |     let mv = s:is_win ? 'move /Y' : 'mv -f' | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user