summaryrefslogtreecommitdiff
path: root/src/eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-04-14 20:42:25 +0000
committerBram Moolenaar <Bram@vim.org>2006-04-14 20:42:25 +0000
commit9e54a0e753578e10910a842d631cffde32d1f133 (patch)
tree493fbfc4e3c943016355f7fd131bd6eadf02fd0a /src/eval.c
parent7fc904b610d5739dd7b72fb2f6b0e4b330c97179 (diff)
downloadvim-git-9e54a0e753578e10910a842d631cffde32d1f133.tar.gz
updated for version 7.0d04v7.0d04
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/eval.c b/src/eval.c
index 45efab72c..8728608e8 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -4696,8 +4696,8 @@ eval7(arg, rettv, evaluate)
}
/*
- * Evaluate an "[expr]" or "[expr:expr]" index.
- * "*arg" points to the '['.
+ * Evaluate an "[expr]" or "[expr:expr]" index. Also "dict.key".
+ * "*arg" points to the '[' or '.'.
* Returns FAIL or OK. "*arg" is advanced to after the ']'.
*/
static int
@@ -4867,7 +4867,9 @@ eval_index(arg, rettv, evaluate, verbose)
if (n2 < 0)
n2 = len + n2;
- if (!empty2 && (n2 < 0 || n2 >= len || n2 + 1 < n1))
+ else if (n2 >= len)
+ n2 = len - 1;
+ if (!empty2 && (n2 < 0 || n2 + 1 < n1))
{
if (verbose)
EMSGN(_(e_listidx), n2);