diff options
author | Bram Moolenaar <Bram@vim.org> | 2014-03-30 16:49:09 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2014-03-30 16:49:09 +0200 |
commit | a392038db5871af6f78fe4d822d9f7126f25eab6 (patch) | |
tree | f5143b9e270cec7da7bee872f59828a1479df80c /src/eval.c | |
parent | 922a4664fe51662a24097b8e74e5f716beef12f4 (diff) | |
download | vim-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.c | 15 |
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; |