diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-01-24 13:34:42 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-01-24 13:34:42 +0100 |
commit | ad36a3588d32985ee27bd11aa97e5195ef623158 (patch) | |
tree | 5d7000acd5dd64d990717fb91ceacd47a3a9dce2 | |
parent | a5be9b62480a6f338a72c01e57c9edd0bca8048b (diff) | |
download | vim-git-ad36a3588d32985ee27bd11aa97e5195ef623158.tar.gz |
patch 8.1.0803: session file has problem with single quote in file namev8.1.0803
Problem: Session file has problem with single quote in file name. (Jon
Crowe)
Solution: Use a double quoted string. Add a test.
-rw-r--r-- | src/ex_docmd.c | 4 | ||||
-rw-r--r-- | src/testdir/test_mksession.vim | 14 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 18 insertions, 2 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index f60bb3492..210fdfa59 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -11838,9 +11838,9 @@ put_view( * edit that buffer, to not lose folding information (:edit resets * folds in other buffers) */ - if (fputs("if bufexists('", fd) < 0 + if (fputs("if bufexists(\"", fd) < 0 || ses_fname(fd, wp->w_buffer, flagp, FALSE) == FAIL - || fputs("') | buffer ", fd) < 0 + || fputs("\") | buffer ", fd) < 0 || ses_fname(fd, wp->w_buffer, flagp, FALSE) == FAIL || fputs(" | else | edit ", fd) < 0 || ses_fname(fd, wp->w_buffer, flagp, FALSE) == FAIL diff --git a/src/testdir/test_mksession.vim b/src/testdir/test_mksession.vim index 00631f13f..145c91cba 100644 --- a/src/testdir/test_mksession.vim +++ b/src/testdir/test_mksession.vim @@ -426,5 +426,19 @@ func Test_mksession_no_errmsg() call delete('Xtest_mks.out') endfunc +func Test_mksession_quote_in_filename() + let v:errmsg = '' + %bwipe! + split another + split x'y\"z + mksession! Xtest_mks_quoted.out + %bwipe! + source Xtest_mks_quoted.out + call assert_true(bufexists("x'y\"z")) + + %bwipe! + call delete('Xtest_mks_quoted.out') +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index 5b404ed80..dcbf1c282 100644 --- a/src/version.c +++ b/src/version.c @@ -792,6 +792,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 803, +/**/ 802, /**/ 801, |