diff options
author | Bart Schaefer <barts@users.sourceforge.net> | 2001-04-24 05:45:16 +0000 |
---|---|---|
committer | Bart Schaefer <barts@users.sourceforge.net> | 2001-04-24 05:45:16 +0000 |
commit | e2e912189359b20efc0b178fd913728e38502b3e (patch) | |
tree | fd7e5a3f3b739ef300f061d2de9f6fafa3a40f27 /Src/subst.c | |
parent | fe8d375ca077fc8c1982fd8c907f2546b127d09a (diff) | |
download | zsh-e2e912189359b20efc0b178fd913728e38502b3e.tar.gz zsh-e2e912189359b20efc0b178fd913728e38502b3e.tar.xz zsh-e2e912189359b20efc0b178fd913728e38502b3e.zip |
Subscripting optimization and error checking.
Diffstat (limited to 'Src/subst.c')
-rw-r--r-- | Src/subst.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Src/subst.c b/Src/subst.c index 27ed6af07..2113123ef 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -1068,7 +1068,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub) s++; v = (Value) NULL; } else if (aspar) { - if ((v = getvalue(&vbuf, &s, 1))) { + if ((v = fetchvalue(&vbuf, &s, 1, (qt ? SCANPM_DQUOTED : 0)))) { val = idbeg = getstrvalue(v); subexp = 1; } else @@ -1080,7 +1080,9 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub) if (!(v = fetchvalue(&vbuf, (subexp ? &ov : &s), (wantt ? -1 : ((unset(KSHARRAYS) || inbrace) ? 1 : -1)), - hkeys|hvals|(arrasg ? SCANPM_ASSIGNING : 0))) || + hkeys|hvals| + (arrasg ? SCANPM_ASSIGNING : 0)| + (qt ? SCANPM_DQUOTED : 0))) || (v->pm && (v->pm->flags & PM_UNSET))) vunset = 1; @@ -1151,7 +1153,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub) v->isarr = isarr; v->pm = pm; v->end = -1; - if (getindex(&s, v) || s == os) + if (getindex(&s, v, qt) || s == os) break; } if ((isarr = v->isarr)) { |