patch 8.2.3656: Vim9: no error for an evironment variable by itself
Problem: Vim9: no error for an evironment variable by itself.
Solution: Give a "without effect" error. (closes #9166)
diff --git a/src/ex_eval.c b/src/ex_eval.c
index 4e38e96..b3c38a1 100644
--- a/src/ex_eval.c
+++ b/src/ex_eval.c
@@ -888,7 +888,8 @@
}
/*
- * 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 @@
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));