1
0
forked from aniani/vim

patch 9.1.0451: No test for escaping '<' with shellescape()

Problem:  No test for escaping '<' with shellescape()
Solution: Add a test.  Use memcpy() in code to make it easier to
          understand.  Fix a typo (zeertzjq).

closes: #14876

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2024-05-30 19:27:25 +02:00
committed by Christian Brabandt
parent 32a5faa6d7
commit 88c8c547d5
4 changed files with 11 additions and 5 deletions

View File

@@ -269,12 +269,12 @@ vim_strsave_shellescape(char_u *string, int do_special, int do_newline)
*d++ = *p++;
continue;
}
if (do_special && find_cmdline_var(p, &l) >= 0 && l > 0)
if (do_special && find_cmdline_var(p, &l) >= 0)
{
*d++ = '\\'; // insert backslash
do // copy the var
*d++ = *p++;
while (--l > 0);
memcpy(d, p, l); // copy the var
d += l;
p += l;
continue;
}
if (*p == '\\' && fish_like)