Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

${foo.__} should not expand to parent node #1126

Merged
merged 1 commit into from
Jan 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions src/cmd/ksh93/sh/name.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,15 +661,6 @@ static_fn char *stack_extend(Shell_t *shp, const char *cname, char *cp, int n) {
return name;
}

static_fn Namval_t *nv_parentnode(Namval_t *np) {
Namval_t *mp = np;
if (nv_istable(np)) return nv_parent(np);
mp = nv_typeparent(np);
if (mp) return mp;
if ((mp = (Namval_t *)np->nvenv) && !nv_isattr(np, NV_EXPORT)) return mp;
return np;
}

Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp) {
Shell_t *shp = sh_getinterp();
char *sub = 0, *cp = (char *)name, *sp, *xp;
Expand Down Expand Up @@ -1047,22 +1038,6 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp) {
cp++;
break;
}
case '_': {
if (cp[1] == '_' && (cp[2] == 0 || cp[2] == '.') && shp->oldnp) {
cp += 2;
dp->last = cp;
nvcache.ok = 0;
shp->oldnp = np = nv_parentnode(shp->oldnp);
siteshwar marked this conversation as resolved.
Show resolved Hide resolved
if (*cp == 0) return np;
sp = nv_name(np);
c = strlen(sp);
dp->nofree |= 1;
name = copystack(shp, (const char *)sp, cp, NULL);
cp = (char *)name + c + 1;
break;
}
}
// FALLTHRU
default: {
shp->oldnp = np ? nq : qp;
qp = 0;
Expand Down