summaryrefslogtreecommitdiff
path: root/src/eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-03-30 16:49:09 +0200
committerBram Moolenaar <Bram@vim.org>2014-03-30 16:49:09 +0200
commita392038db5871af6f78fe4d822d9f7126f25eab6 (patch)
treef5143b9e270cec7da7bee872f59828a1479df80c /src/eval.c
parent922a4664fe51662a24097b8e74e5f716beef12f4 (diff)
downloadvim-a392038db5871af6f78fe4d822d9f7126f25eab6.zip
updated for version 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)
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/eval.c b/src/eval.c
index baaa12f01..d9785c4a1 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1856,8 +1856,9 @@ ex_let(eap)
return;
if (argend > arg && argend[-1] == '.') /* for var.='str' */
--argend;
- expr = vim_strchr(argend, '=');
- if (expr == NULL)
+ expr = skipwhite(argend);
+ if (*expr != '=' && !(vim_strchr((char_u *)"+-.", *expr) != NULL
+ && expr[1] == '='))
{
/*
* ":let" without "=": list variables
@@ -1886,12 +1887,14 @@ ex_let(eap)
{
op[0] = '=';
op[1] = NUL;
- if (expr > argend)
+ if (*expr != '=')
{
- if (vim_strchr((char_u *)"+-.", expr[-1]) != NULL)
- op[0] = expr[-1]; /* +=, -= or .= */
+ if (vim_strchr((char_u *)"+-.", *expr) != NULL)
+ op[0] = *expr; /* +=, -= or .= */
+ expr = skipwhite(expr + 2);
}
- expr = skipwhite(expr + 1);
+ else
+ expr = skipwhite(expr + 1);
if (eap->skip)
++emsg_skip;