patch 8.0.0625: shellescape() always escapes a newline
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 #1590)
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 60cd344..c198df1 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -10461,8 +10461,10 @@
static void
f_shellescape(typval_T *argvars, typval_T *rettv)
{
+ int do_special = non_zero_arg(&argvars[1]);
+
rettv->vval.v_string = vim_strsave_shellescape(
- get_tv_string(&argvars[0]), non_zero_arg(&argvars[1]), TRUE);
+ get_tv_string(&argvars[0]), do_special, do_special);
rettv->v_type = VAR_STRING;
}