summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0945
blob: d0c6390657e95d73a0da418e1a00335cbbf2e1a8 (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0945
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.0945
Problem:    Internal error when using pattern with NL in the range.
Solution:   Use an actual newline for the range. (closes #3989)  Also fix 
            error message.  (Dominique Pelle)
Files:      src/regexp_nfa.c, src/testdir/test_regexp_latin.vim


*** ../vim-8.1.0944/src/regexp_nfa.c	2019-02-14 20:55:05.983776869 +0100
--- src/regexp_nfa.c	2019-02-17 20:11:05.243105933 +0100
***************
*** 245,251 ****
  
  static char_u e_nul_found[] = N_("E865: (NFA) Regexp end encountered prematurely");
  static char_u e_misplaced[] = N_("E866: (NFA regexp) Misplaced %c");
! static char_u e_ill_char_class[] = N_("E877: (NFA regexp) Invalid character class: %ld");
  
  // Variables only used in nfa_regcomp() and descendants.
  static int nfa_re_flags; // re_flags passed to nfa_regcomp()
--- 245,251 ----
  
  static char_u e_nul_found[] = N_("E865: (NFA) Regexp end encountered prematurely");
  static char_u e_misplaced[] = N_("E866: (NFA regexp) Misplaced %c");
! static char_u e_ill_char_class[] = N_("E877: (NFA regexp) Invalid character class: %d");
  
  // Variables only used in nfa_regcomp() and descendants.
  static int nfa_re_flags; // re_flags passed to nfa_regcomp()
***************
*** 1785,1791 ****
  			MB_PTR_ADV(regparse);
  
  			if (*regparse == 'n')
! 			    startc = reg_string ? NL : NFA_NEWL;
  			else
  			    if  (*regparse == 'd'
  				    || *regparse == 'o'
--- 1785,1792 ----
  			MB_PTR_ADV(regparse);
  
  			if (*regparse == 'n')
! 			    startc = (reg_string || emit_range
! 					|| regparse[1] == '-') ? NL : NFA_NEWL;
  			else
  			    if  (*regparse == 'd'
  				    || *regparse == 'o'
*** ../vim-8.1.0944/src/testdir/test_regexp_latin.vim	2019-02-17 13:53:31.600227794 +0100
--- src/testdir/test_regexp_latin.vim	2019-02-17 20:10:57.103144259 +0100
***************
*** 122,124 ****
--- 122,132 ----
    bwipe!
    set re=0
  endfunc
+ 
+ func Test_range_with_newline()
+   new
+   call setline(1, "a")
+   call assert_equal(0, search("[ -*\\n- ]"))
+   call assert_equal(0, search("[ -*\\t-\\n]"))
+   bwipe!
+ endfunc
*** ../vim-8.1.0944/src/version.c	2019-02-17 19:12:17.646329910 +0100
--- src/version.c	2019-02-17 20:11:44.602919414 +0100
***************
*** 781,782 ****
--- 781,784 ----
  {   /* Add new patch number below this line */
+ /**/
+     945,
  /**/

-- 
An easy way to determine if you have enough teamwork to be doomed is simply to
measure how long it takes from the time you decide to go to lunch together
until the time you actually eat.
				(Scott Adams - The Dilbert principle)

 /// 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    ///