mirror of
https://github.com/neovim/neovim.git
synced 2025-09-12 06:18:16 +00:00
vim-patch:7.4.191
Problem: Escaping a file name for shell commands can't be done without a function. Solution: Add the :S file name modifier. https://code.google.com/p/vim/source/detail?r=40f18a1c1592c8b4047f6f2a413557f48a99c55f
This commit is contained in:

committed by
Thiago de Arruda

parent
644ccdafe0
commit
a881273dad
10
src/eval.c
10
src/eval.c
@@ -13715,7 +13715,7 @@ static void f_sha256(typval_T *argvars, typval_T *rettv)
|
||||
static void f_shellescape(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
rettv->vval.v_string = vim_strsave_shellescape(
|
||||
get_tv_string(&argvars[0]), non_zero_arg(&argvars[1]));
|
||||
get_tv_string(&argvars[0]), non_zero_arg(&argvars[1]), true);
|
||||
rettv->v_type = VAR_STRING;
|
||||
}
|
||||
|
||||
@@ -19645,6 +19645,14 @@ repeat:
|
||||
}
|
||||
}
|
||||
|
||||
if (src[*usedlen] == ':' && src[*usedlen + 1] == 'S') {
|
||||
p = vim_strsave_shellescape(*fnamep, false, false);
|
||||
vim_free(*bufp);
|
||||
*bufp = *fnamep = p;
|
||||
*fnamelen = (int)STRLEN(p);
|
||||
*usedlen += 2;
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user