summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0748
blob: 65f4aba43677f375c03abacc99451aedd8ce6b40 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0748
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.0748
Problem:    Using sprintf() instead of semsg().
Solution:   Use semsg().  Fix bug with E888. (Ozaki Kiichi, closes #3801)
Files:	    src/regexp.c


*** ../vim-8.1.0747/src/regexp.c	2019-01-13 23:38:33.407773189 +0100
--- src/regexp.c	2019-01-14 22:39:42.656618226 +0100
***************
*** 338,343 ****
--- 338,344 ----
  #define IEMSG_RET_NULL(m) return (iemsg((m)), rc_did_emsg = TRUE, (void *)NULL)
  #define EMSG_RET_FAIL(m) return (emsg((m)), rc_did_emsg = TRUE, FAIL)
  #define EMSG2_RET_NULL(m, c) return (semsg((const char *)(m), (c) ? "" : "\\"), rc_did_emsg = TRUE, (void *)NULL)
+ #define EMSG3_RET_NULL(m, c, a) return (semsg((const char *)(m), (c) ? "" : "\\", (a)), rc_did_emsg = TRUE, (void *)NULL)
  #define EMSG2_RET_FAIL(m, c) return (semsg((const char *)(m), (c) ? "" : "\\"), rc_did_emsg = TRUE, FAIL)
  #define EMSG_ONE_RET_NULL EMSG2_RET_NULL(_("E369: invalid item in %s%%[]"), reg_magic == MAGIC_ALL)
  
***************
*** 1895,1908 ****
      }
      if (re_multi_type(peekchr()) != NOT_MULTI)
      {
! 	/* Can't have a multi follow a multi. */
  	if (peekchr() == Magic('*'))
! 	    sprintf((char *)IObuff, _("E61: Nested %s*"),
! 					    reg_magic >= MAGIC_ON ? "" : "\\");
! 	else
! 	    sprintf((char *)IObuff, _("E62: Nested %s%c"),
! 		reg_magic == MAGIC_ALL ? "" : "\\", no_Magic(peekchr()));
! 	EMSG_RET_NULL((char *)IObuff);
      }
  
      return ret;
--- 1896,1906 ----
      }
      if (re_multi_type(peekchr()) != NOT_MULTI)
      {
! 	// Can't have a multi follow a multi.
  	if (peekchr() == Magic('*'))
! 	    EMSG2_RET_NULL(_("E61: Nested %s*"), reg_magic >= MAGIC_ON);
! 	EMSG3_RET_NULL(_("E62: Nested %s%c"), reg_magic == MAGIC_ALL,
! 							  no_Magic(peekchr()));
      }
  
      return ret;
***************
*** 2075,2084 ****
        case Magic('{'):
        case Magic('*'):
  	c = no_Magic(c);
! 	sprintf((char *)IObuff, _("E64: %s%c follows nothing"),
! 		(c == '*' ? reg_magic >= MAGIC_ON : reg_magic == MAGIC_ALL)
! 		? "" : "\\", c);
! 	EMSG_RET_NULL((char *)IObuff);
  	/* NOTREACHED */
  
        case Magic('~'):		/* previous substitute pattern */
--- 2073,2080 ----
        case Magic('{'):
        case Magic('*'):
  	c = no_Magic(c);
! 	EMSG3_RET_NULL(_("E64: %s%c follows nothing"),
! 		(c == '*' ? reg_magic >= MAGIC_ON : reg_magic == MAGIC_ALL), c);
  	/* NOTREACHED */
  
        case Magic('~'):		/* previous substitute pattern */
***************
*** 3403,3413 ****
      if (*regparse == '\\')
  	regparse++;	/* Allow either \{...} or \{...\} */
      if (*regparse != '}')
!     {
! 	sprintf((char *)IObuff, _("E554: Syntax error in %s{...}"),
! 					  reg_magic == MAGIC_ALL ? "" : "\\");
! 	EMSG_RET_FAIL((char *)IObuff);
!     }
  
      /*
       * Reverse the range if there was a '-', or make sure it is in the right
--- 3399,3406 ----
      if (*regparse == '\\')
  	regparse++;	/* Allow either \{...} or \{...\} */
      if (*regparse != '}')
! 	EMSG2_RET_FAIL(_("E554: Syntax error in %s{...}"),
! 						       reg_magic == MAGIC_ALL);
  
      /*
       * Reverse the range if there was a '-', or make sure it is in the right
***************
*** 6998,7004 ****
  re_mult_next(char *what)
  {
      if (re_multi_type(peekchr()) == MULTI_MULT)
! 	EMSG2_RET_FAIL(_("E888: (NFA regexp) cannot repeat %s"), what);
      return OK;
  }
  
--- 6991,7001 ----
  re_mult_next(char *what)
  {
      if (re_multi_type(peekchr()) == MULTI_MULT)
!     {
!        semsg(_("E888: (NFA regexp) cannot repeat %s"), what);
!        rc_did_emsg = TRUE;
!        return FAIL;
!     }
      return OK;
  }
  
*** ../vim-8.1.0747/src/version.c	2019-01-14 22:22:25.584624342 +0100
--- src/version.c	2019-01-14 22:45:14.998094549 +0100
***************
*** 797,798 ****
--- 797,800 ----
  {   /* Add new patch number below this line */
+ /**/
+     748,
  /**/

-- 
$ echo pizza > /dev/oven

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