diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-08-05 10:53:21 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-08-05 10:53:21 +0200 |
commit | bb1b5e24ecc0abe1fee164e9de13796989eff784 (patch) | |
tree | cd42f7d7632663f57a56c31026392f9d26f72444 /src/evalvars.c | |
parent | 282f9c64e570e832d3eba12950da15c9f1a40f06 (diff) | |
download | vim-git-bb1b5e24ecc0abe1fee164e9de13796989eff784.tar.gz |
patch 8.2.1365: Vim9: no error for missing white space around operatorv8.2.1365
Problem: Vim9: no error for missing white space around operator.
Solution: Check for white space. (closes #6618)
Diffstat (limited to 'src/evalvars.c')
-rw-r--r-- | src/evalvars.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/evalvars.c b/src/evalvars.c index cf75487ea..869deefc2 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -1137,6 +1137,7 @@ list_arg_vars(exarg_T *eap, char_u *arg, int *first) } else { + arg = skipwhite(arg); if (tofree != NULL) name = tofree; if (eval_variable(name, len, &tv, NULL, TRUE, FALSE) == FAIL) @@ -3358,6 +3359,7 @@ assert_error(garray_T *gap) int var_exists(char_u *var) { + char_u *arg = var; char_u *name; char_u *tofree; typval_T tv; @@ -3366,7 +3368,7 @@ var_exists(char_u *var) // get_name_len() takes care of expanding curly braces name = var; - len = get_name_len(&var, &tofree, TRUE, FALSE); + len = get_name_len(&arg, &tofree, TRUE, FALSE); if (len > 0) { if (tofree != NULL) @@ -3375,12 +3377,13 @@ var_exists(char_u *var) if (n) { // handle d.key, l[idx], f(expr) - n = (handle_subscript(&var, &tv, &EVALARG_EVALUATE, FALSE) == OK); + arg = skipwhite(arg); + n = (handle_subscript(&arg, &tv, &EVALARG_EVALUATE, FALSE) == OK); if (n) clear_tv(&tv); } } - if (*var != NUL) + if (*arg != NUL) n = FALSE; vim_free(tofree); |