blob: c6cfaf99a35560acfc4c3011210b45f851af6670 (
plain)
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
|
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0555
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.0555
Problem: Crash when last search pat is set but not last substitute pat.
Solution: Do not mix up last search pattern and last subtitute pattern.
(closes #3647)
Files: src/search.c, src/testdir/test_search.vim
*** ../vim-8.1.0554/src/search.c 2018-11-30 21:57:50.723861874 +0100
--- src/search.c 2018-12-01 13:09:58.124716701 +0100
***************
*** 1385,1391 ****
char_u *trunc;
if (*searchstr == NUL)
! p = spats[last_idx].pat;
else
p = searchstr;
msgbuf = alloc((unsigned)(STRLEN(p) + 40));
--- 1385,1391 ----
char_u *trunc;
if (*searchstr == NUL)
! p = spats[0].pat;
else
p = searchstr;
msgbuf = alloc((unsigned)(STRLEN(p) + 40));
*** ../vim-8.1.0554/src/testdir/test_search.vim 2018-09-16 17:07:40.125853848 +0200
--- src/testdir/test_search.vim 2018-12-01 13:11:24.096343712 +0100
***************
*** 1142,1144 ****
--- 1142,1156 ----
/\%'(
/
endfunc
+
+ " Test that there is no crash when there is a last search pattern but no last
+ " substitute pattern.
+ func Test_no_last_substitute_pat()
+ " Use viminfo to set the last search pattern to a string and make the last
+ " substitute pattern the most recent used and make it empty (NULL).
+ call writefile(['~MSle0/bar', '~MSle0~&'], 'Xviminfo')
+ rviminfo! Xviminfo
+ call assert_fails('normal n', 'E35:')
+
+ call delete('Xviminfo')
+ endfunc
*** ../vim-8.1.0554/src/version.c 2018-12-01 11:58:44.415064948 +0100
--- src/version.c 2018-12-01 13:11:33.232302706 +0100
***************
*** 794,795 ****
--- 794,797 ----
{ /* Add new patch number below this line */
+ /**/
+ 555,
/**/
--
"I love deadlines. I especially like the whooshing sound they
make as they go flying by."
-- Douglas Adams
/// 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 ///
|