summaryrefslogtreecommitdiff
path: root/bin/ksh/eval.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2011-10-11 14:32:44 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2011-10-11 14:32:44 +0000
commit011c514a02df1a21ef406cb30bf13c6fd1b61f20 (patch)
treec2d69cff8fcf6bd4fc94b134d0937679414a997a /bin/ksh/eval.c
parentca50fa940e9f94437f637b0dbd16791686def4e4 (diff)
gc unused var; from Michael W. Bombardieri
Diffstat (limited to 'bin/ksh/eval.c')
-rw-r--r--bin/ksh/eval.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/bin/ksh/eval.c b/bin/ksh/eval.c
index 257bd02e519..f966df4778b 100644
--- a/bin/ksh/eval.c
+++ b/bin/ksh/eval.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eval.c,v 1.36 2011/03/15 08:39:54 okan Exp $ */
+/* $OpenBSD: eval.c,v 1.37 2011/10/11 14:32:43 otto Exp $ */
/*
* Expansion - quoting, separation, substitution, globbing
@@ -712,16 +712,13 @@ varsub(Expand *xp, char *sp, char *word,
/* Check for size of array */
if ((p=strchr(sp,'[')) && (p[1]=='*'||p[1]=='@') && p[2]==']') {
int n = 0;
- int max = 0;
vp = global(arrayname(sp));
if (vp->flag & (ISSET|ARRAY))
zero_ok = 1;
for (; vp; vp = vp->u.array)
- if (vp->flag & ISSET) {
- max = vp->index + 1;
+ if (vp->flag & ISSET)
n++;
- }
c = n; /* ksh88/ksh93 go for number, not max index */
} else if (c == '*' || c == '@')
c = e->loc->argc;