1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0803
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------
Patch 8.1.0803
Problem: Session file has problem with single quote in file name. (Jon
Crowe)
Solution: Use a double quoted string. Add a test.
Files: src/ex_docmd.c, src/testdir/test_mksession.vim
*** ../vim-8.1.0802/src/ex_docmd.c 2019-01-22 22:41:38.362850472 +0100
--- src/ex_docmd.c 2019-01-24 13:28:50.018069901 +0100
***************
*** 11838,11846 ****
* edit that buffer, to not lose folding information (:edit resets
* folds in other buffers)
*/
! if (fputs("if bufexists('", fd) < 0
|| ses_fname(fd, wp->w_buffer, flagp, FALSE) == FAIL
! || 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
--- 11838,11846 ----
* edit that buffer, to not lose folding information (:edit resets
* folds in other buffers)
*/
! if (fputs("if bufexists(\"", fd) < 0
|| ses_fname(fd, wp->w_buffer, flagp, FALSE) == FAIL
! || 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
*** ../vim-8.1.0802/src/testdir/test_mksession.vim 2019-01-21 23:03:45.718447626 +0100
--- src/testdir/test_mksession.vim 2019-01-24 13:30:48.257167620 +0100
***************
*** 426,430 ****
--- 426,444 ----
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
*** ../vim-8.1.0802/src/version.c 2019-01-24 12:31:40.756926525 +0100
--- src/version.c 2019-01-24 13:30:55.837110446 +0100
***************
*** 793,794 ****
--- 793,796 ----
{ /* Add new patch number below this line */
+ /**/
+ 803,
/**/
--
Experience is what you get when you don't get what you want.
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|