summaryrefslogtreecommitdiffstats
path: root/src/ex_eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-11-23 14:52:06 +0000
committerBram Moolenaar <Bram@vim.org>2021-11-23 14:52:06 +0000
commit65259b5c6a8ad4edaf6eeb8dbb7b50342c64d403 (patch)
tree3292326c6148c61257464f291f5ee5a1b9e2432d /src/ex_eval.c
parentcc9d725bbb515baf172c2be21de12d35a961e4ee (diff)
patch 8.2.3656: Vim9: no error for an evironment variable by itselfv8.2.3656
Problem: Vim9: no error for an evironment variable by itself. Solution: Give a "without effect" error. (closes #9166)
Diffstat (limited to 'src/ex_eval.c')
-rw-r--r--src/ex_eval.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ex_eval.c b/src/ex_eval.c
index 4e38e96491..b3c38a1ea5 100644
--- a/src/ex_eval.c
+++ b/src/ex_eval.c
@@ -888,7 +888,8 @@ report_discard_pending(int pending, void *value)
}
/*
- * Return TRUE if "arg" is only a variable, register or option name.
+ * Return TRUE if "arg" is only a variable, register, environment variable or
+ * option name.
*/
int
cmd_is_name_only(char_u *arg)
@@ -911,6 +912,8 @@ cmd_is_name_only(char_u *arg)
if (STRNCMP("l:", p, 2) == 0 || STRNCMP("g:", p, 2) == 0)
p += 2;
}
+ else if (*p == '$')
+ ++p;
get_name_len(&p, &alias, FALSE, FALSE);
}
name_only = ends_excmd2(arg, skipwhite(p));