mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 09:18:19 +00:00
vim-patch:7.4.1643
Problem: Terminating file name has side effects.
Solution: Restore the character. (mostly by James McCoy, closes vim/vim#713)
d4caf5c16a
This commit is contained in:
@@ -21994,8 +21994,10 @@ repeat:
|
|||||||
|
|
||||||
if (src[*usedlen] == ':' && src[*usedlen + 1] == 'S') {
|
if (src[*usedlen] == ':' && src[*usedlen + 1] == 'S') {
|
||||||
// vim_strsave_shellescape() needs a NUL terminated string.
|
// vim_strsave_shellescape() needs a NUL terminated string.
|
||||||
|
c = (*fnamep)[*fnamelen];
|
||||||
(*fnamep)[*fnamelen] = NUL;
|
(*fnamep)[*fnamelen] = NUL;
|
||||||
p = vim_strsave_shellescape(*fnamep, false, false);
|
p = vim_strsave_shellescape(*fnamep, false, false);
|
||||||
|
(*fnamep)[*fnamelen] = c;
|
||||||
xfree(*bufp);
|
xfree(*bufp);
|
||||||
*bufp = *fnamep = p;
|
*bufp = *fnamep = p;
|
||||||
*fnamelen = STRLEN(p);
|
*fnamelen = STRLEN(p);
|
||||||
|
@@ -69,6 +69,7 @@ static char *features[] = {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static int included_patches[] = {
|
static int included_patches[] = {
|
||||||
|
1643,
|
||||||
1641,
|
1641,
|
||||||
1574,
|
1574,
|
||||||
1570,
|
1570,
|
||||||
|
@@ -44,6 +44,9 @@ describe('filename modifiers', function()
|
|||||||
execute([=[Put fnamemodify('abc''%''def', ':S' )]=])
|
execute([=[Put fnamemodify('abc''%''def', ':S' )]=])
|
||||||
execute([=[Put fnamemodify("abc\ndef", ':S' )]=])
|
execute([=[Put fnamemodify("abc\ndef", ':S' )]=])
|
||||||
execute([=[Put expand('%:r:S') == shellescape(expand('%:r'))]=])
|
execute([=[Put expand('%:r:S') == shellescape(expand('%:r'))]=])
|
||||||
|
execute([=[new foo.txt]=])
|
||||||
|
execute([=[Put join([expand('%:r'), expand('%:r:S'), expand('%')], ',')]=])
|
||||||
|
execute([=[quit]=])
|
||||||
execute([=[set shell=tcsh]=])
|
execute([=[set shell=tcsh]=])
|
||||||
execute([=[Put fnamemodify("abc\ndef", ':S' )]=])
|
execute([=[Put fnamemodify("abc\ndef", ':S' )]=])
|
||||||
execute([=[1 delete _]=])
|
execute([=[1 delete _]=])
|
||||||
@@ -77,6 +80,7 @@ describe('filename modifiers', function()
|
|||||||
fnamemodify('abc'' ''def', ':S' ) '''abc''\'''' ''\''''def'''
|
fnamemodify('abc'' ''def', ':S' ) '''abc''\'''' ''\''''def'''
|
||||||
fnamemodify('abc''%''def', ':S' ) '''abc''\''''%''\''''def'''
|
fnamemodify('abc''%''def', ':S' ) '''abc''\''''%''\''''def'''
|
||||||
fnamemodify("abc\ndef", ':S' ) '''abc^@def'''
|
fnamemodify("abc\ndef", ':S' ) '''abc^@def'''
|
||||||
|
join([expand('%:r'), expand('%:r:S'), expand('%')], ',') 'foo,''foo'',foo.txt'
|
||||||
expand('%:r:S') == shellescape(expand('%:r')) 1
|
expand('%:r:S') == shellescape(expand('%:r')) 1
|
||||||
fnamemodify("abc\ndef", ':S' ) '''abc\^@def''']=])
|
fnamemodify("abc\ndef", ':S' ) '''abc\^@def''']=])
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user