summaryrefslogtreecommitdiffstats
path: root/patches/source/vim/patches/7.4.229
blob: e77a98cfb022fd22c6011b3584c4d8b645a189d7 (plain) (blame)
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
137
138
139
140
141
To: vim_dev@googlegroups.com
Subject: Patch 7.4.229
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.4.229
Problem:    Using ":let" for listing variables and the second one is a curly
	    braces expression may fail.
Solution:   Check for an "=" in a better way. (ZyX)
Files:	    src/eval.c, src/testdir/test104.in, src/testdir/test104.ok


*** ../vim-7.4.228/src/eval.c	2014-03-25 18:23:27.062087691 +0100
--- src/eval.c	2014-03-30 16:46:24.464562806 +0200
***************
*** 1856,1863 ****
  	return;
      if (argend > arg && argend[-1] == '.')  /* for var.='str' */
  	--argend;
!     expr = vim_strchr(argend, '=');
!     if (expr == NULL)
      {
  	/*
  	 * ":let" without "=": list variables
--- 1856,1864 ----
  	return;
      if (argend > arg && argend[-1] == '.')  /* for var.='str' */
  	--argend;
!     expr = skipwhite(argend);
!     if (*expr != '=' && !(vim_strchr((char_u *)"+-.", *expr) != NULL
! 			  && expr[1] == '='))
      {
  	/*
  	 * ":let" without "=": list variables
***************
*** 1886,1897 ****
      {
  	op[0] = '=';
  	op[1] = NUL;
! 	if (expr > argend)
  	{
! 	    if (vim_strchr((char_u *)"+-.", expr[-1]) != NULL)
! 		op[0] = expr[-1];   /* +=, -= or .= */
  	}
! 	expr = skipwhite(expr + 1);
  
  	if (eap->skip)
  	    ++emsg_skip;
--- 1887,1900 ----
      {
  	op[0] = '=';
  	op[1] = NUL;
! 	if (*expr != '=')
  	{
! 	    if (vim_strchr((char_u *)"+-.", *expr) != NULL)
! 		op[0] = *expr;   /* +=, -= or .= */
! 	    expr = skipwhite(expr + 2);
  	}
! 	else
! 	    expr = skipwhite(expr + 1);
  
  	if (eap->skip)
  	    ++emsg_skip;
*** ../vim-7.4.228/src/testdir/test104.in	2014-02-05 22:25:29.982568243 +0100
--- src/testdir/test104.in	2014-03-30 16:44:39.432561197 +0200
***************
*** 1,4 ****
! Tests for autoload.  vim: set ft=vim ts=8 :
  
  STARTTEST
  :so small.vim
--- 1,4 ----
! Tests for :let.  vim: set ft=vim ts=8 :
  
  STARTTEST
  :so small.vim
***************
*** 10,15 ****
--- 10,29 ----
  :catch
  :  $put ='FAIL: ' . v:exception
  :endtry
+ :let a = 1
+ :let b = 2
+ :for letargs in ['a b', '{0 == 1 ? "a" : "b"}', '{0 == 1 ? "a" : "b"} a', 'a {0 == 1 ? "a" : "b"}']
+ :  try
+ :    redir => messages
+ :    execute 'let' letargs
+ :    redir END
+ :    $put ='OK:'
+ :    $put =split(substitute(messages, '\n', '\0  ', 'g'), '\n')
+ :  catch
+ :    $put ='FAIL: ' . v:exception
+ :    redir END
+ :  endtry
+ :endfor
  :/^Results/,$wq! test.out
  ENDTEST
  
*** ../vim-7.4.228/src/testdir/test104.ok	2014-02-05 22:25:29.982568243 +0100
--- src/testdir/test104.ok	2014-03-30 16:44:39.432561197 +0200
***************
*** 1,2 ****
--- 1,13 ----
  Results of test104:
  OK: function('tr')
+ OK:
+   a                     #1
+   b                     #2
+ OK:
+   b                     #2
+ OK:
+   b                     #2
+   a                     #1
+ OK:
+   a                     #1
+   b                     #2
*** ../vim-7.4.228/src/version.c	2014-03-30 16:11:37.180530823 +0200
--- src/version.c	2014-03-30 16:46:39.660563039 +0200
***************
*** 736,737 ****
--- 736,739 ----
  {   /* Add new patch number below this line */
+ /**/
+     229,
  /**/

-- 
You have heard the saying that if you put a thousand monkeys in a room with a
thousand typewriters and waited long enough, eventually you would have a room
full of dead monkeys.
				(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    ///