From f00fdfe72537ff8e2547fe22321c50fa9205f5b4 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Sat, 8 Oct 2005 18:03:00 +0000 Subject: Tell user which value of index is out of bounds. ok deraadt@ --- bin/ksh/var.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/ksh/var.c b/bin/ksh/var.c index cd58c4b3d40..733f82f2967 100644 --- a/bin/ksh/var.c +++ b/bin/ksh/var.c @@ -1,4 +1,4 @@ -/* $OpenBSD: var.c,v 1.26 2005/03/30 17:16:37 deraadt Exp $ */ +/* $OpenBSD: var.c,v 1.27 2005/10/08 18:02:59 otto Exp $ */ #include "sh.h" #include @@ -143,7 +143,7 @@ array_index_calc(const char *n, bool *arrayp, int *valp) n = str_nsave(n, p - n, ATEMP); evaluate(sub, &rval, KSH_UNWIND_ERROR, true); if (rval < 0 || rval > ARRAYMAX) - errorf("%s: subscript out of range", n); + errorf("%s: subscript %ld out of range", n, rval); *valp = rval; afree(sub, ATEMP); } -- cgit v1.2.3