fix vstrchr like use of cstrchr

This commit is contained in:
tg 2011-07-02 17:57:02 +00:00
parent 257021e510
commit b89c144344
1 changed files with 2 additions and 2 deletions

4
eval.c
View File

@ -22,7 +22,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.105 2011/06/12 14:45:33 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/eval.c,v 1.106 2011/07/02 17:57:02 tg Exp $");
/* /*
* string expansion * string expansion
@ -1181,7 +1181,7 @@ varsub(Expand *xp, const char *sp, const char *word,
if (*sp == '!' && sp[1]) { if (*sp == '!' && sp[1]) {
++sp; ++sp;
xp->var = global(sp); xp->var = global(sp);
if (cstrchr(sp, '[')) { if (vstrchr(sp, '[')) {
if (xp->var->flag & ISSET) if (xp->var->flag & ISSET)
xp->str = shf_smprintf("%lu", xp->str = shf_smprintf("%lu",
arrayindex(xp->var)); arrayindex(xp->var));