mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 01:46:29 +00:00
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: vim/vim#14876
88c8c547d5
This commit is contained in:
@@ -266,11 +266,11 @@ char *vim_strsave_shellescape(const char *string, bool do_special, bool do_newli
|
||||
*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) {
|
||||
|
Reference in New Issue
Block a user