aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2018-06-17 06:20:42 -0400
committerJustin M. Keyes <justinkz@gmail.com>2018-06-17 12:20:42 +0200
commit367343ae6e1e269f49ea29ac767628f9e4e825ac (patch)
treeee545baa63555bd063c855f372800102176abdef /src/nvim/eval.c
parentb006771cba7b9db6f0b4214b2251e3dd742a1228 (diff)
downloadrneovim-367343ae6e1e269f49ea29ac767628f9e4e825ac.tar.gz
rneovim-367343ae6e1e269f49ea29ac767628f9e4e825ac.tar.bz2
rneovim-367343ae6e1e269f49ea29ac767628f9e4e825ac.zip
vim-patch:8.0.0625: shellescape() always escapes a newline (#8573)
Problem: shellescape() always escapes a newline, which does not work with some shells. (Harm te Hennepe) Solution: Only escape a newline when the "special" argument is non-zero. (Christian Brabandt, closes vim/vim#1590) https://github.com/vim/vim/commit/206155280def51160a9d81d983aed639015ffb44
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index eb437931d4..d8d785395c 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -15066,9 +15066,10 @@ static void f_sha256(typval_T *argvars, typval_T *rettv, FunPtr fptr)
*/
static void f_shellescape(typval_T *argvars, typval_T *rettv, FunPtr fptr)
{
+ const bool do_special = non_zero_arg(&argvars[1]);
+
rettv->vval.v_string = vim_strsave_shellescape(
- (const char_u *)tv_get_string(&argvars[0]), non_zero_arg(&argvars[1]),
- true);
+ (const char_u *)tv_get_string(&argvars[0]), do_special, do_special);
rettv->v_type = VAR_STRING;
}