1
0
forked from aniani/vim

updated for version 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.
This commit is contained in:
Bram Moolenaar
2014-02-23 23:39:13 +01:00
parent 581966e832
commit 26df092843
20 changed files with 126 additions and 26 deletions

View File

@@ -16950,7 +16950,7 @@ f_shellescape(argvars, rettv)
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;
}
@@ -24355,6 +24355,17 @@ repeat:
}
}
if (src[*usedlen] == ':' && src[*usedlen + 1] == 'S')
{
p = vim_strsave_shellescape(*fnamep, FALSE, FALSE);
if (p == NULL)
return -1;
vim_free(*bufp);
*bufp = *fnamep = p;
*fnamelen = (int)STRLEN(p);
*usedlen += 2;
}
return valid;
}