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:
oni-link
2014-04-12 23:04:49 +02:00
committed by Thiago de Arruda
parent 644ccdafe0
commit a881273dad
8 changed files with 95 additions and 14 deletions

View File

@@ -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;
}