mirror of
https://github.com/neovim/neovim.git
synced 2025-09-12 06:18:16 +00:00
vim-patch:8.2.3393: escaping for fish shell is skipping some characters
Problem: Escaping for fish shell is skipping some characters.
Solution: Escape character after backslash if needed. (Jason Cox,
closes vim/vim#8827)
6631597452
This commit is contained in:
@@ -278,6 +278,7 @@ char_u *vim_strsave_shellescape(const char_u *string,
|
|||||||
if (*p == '\\' && fish_like) {
|
if (*p == '\\' && fish_like) {
|
||||||
*d++ = '\\';
|
*d++ = '\\';
|
||||||
*d++ = *p++;
|
*d++ = *p++;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
MB_COPY_CHAR(p, d);
|
MB_COPY_CHAR(p, d);
|
||||||
|
@@ -1174,6 +1174,14 @@ func Test_shellescape()
|
|||||||
|
|
||||||
call assert_equal("'te\\\\xt'", shellescape("te\\xt"))
|
call assert_equal("'te\\\\xt'", shellescape("te\\xt"))
|
||||||
call assert_equal("'te\\\\xt'", shellescape("te\\xt", 1))
|
call assert_equal("'te\\\\xt'", shellescape("te\\xt", 1))
|
||||||
|
call assert_equal("'te\\\\'\\''xt'", shellescape("te\\'xt"))
|
||||||
|
call assert_equal("'te\\\\'\\''xt'", shellescape("te\\'xt", 1))
|
||||||
|
call assert_equal("'te\\\\!xt'", shellescape("te\\!xt"))
|
||||||
|
call assert_equal("'te\\\\\\!xt'", shellescape("te\\!xt", 1))
|
||||||
|
call assert_equal("'te\\\\%xt'", shellescape("te\\%xt"))
|
||||||
|
call assert_equal("'te\\\\\\%xt'", shellescape("te\\%xt", 1))
|
||||||
|
call assert_equal("'te\\\\#xt'", shellescape("te\\#xt"))
|
||||||
|
call assert_equal("'te\\\\\\#xt'", shellescape("te\\#xt", 1))
|
||||||
|
|
||||||
let &shell = save_shell
|
let &shell = save_shell
|
||||||
endfunc
|
endfunc
|
||||||
|
Reference in New Issue
Block a user