Skip to content

Commit

Permalink
Streamline some nval(3) and related flaggery
Browse files Browse the repository at this point in the history
In the olden days, ksh used the hash(3) library to store variables,
aliases, functions, etc. For many years, it's been using the cdt(3)
library instead. But the low-level nv_search() name-value tree
lookup function was still repurposing some bit flags from the old
hash API for its options, though that API is otherwise unused.

So we were still including the entire obsolete <hash.h> API just
to use two repurposed HASH_* bit flags for nv_search(). This commit
makes nv_search() repurpose some flags from <nval.h> instead.

This commit should not change ksh's behaviour.

src/cmd/ksh93/sh/nvdisc.c:
- Make nv_search() use NV_NOSCOPE instead of HASH_NOSCOPE and
  NV_REF instead of HASH_BUCKET.
- The HASH_SCOPE flag was also passed to some nv_search() calls,
  but nv_search() ignores it, so that flag is deleted from those.
- Document nv_search() in a comment.

src/cmd/ksh93/include/name.h:
- Move NV_UNATTR to nval.h to join the other nv_open() options
  there. (re: 1184b2a)

src/cmd/ksh93/include/nval.h:
- Since we no longer use HASH_* macros, do not include <hash.h>.
- Remove unused NV_NOASSIGN macro, defined to 0. This was there
  for "backward compatibility" since before 1995; long enough.

src/cmd/ksh93/include/shell.h:
- Bump SH_VERSION due to the nv_search() API change (even though no
  changes were made to the APIs documented in nval.3 or shell.3).

All other changed files:
- Update to match the flaggery changes.
  • Loading branch information
McDutchie committed Jul 20, 2022
1 parent 60b3e3a commit 1884f57
Show file tree
Hide file tree
Showing 21 changed files with 74 additions and 69 deletions.
4 changes: 0 additions & 4 deletions src/cmd/ksh93/Mamfile
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,6 @@ make install
done ${PACKAGE_ast_INCLUDE}/cmd.h dontcare
prev ${PACKAGE_ast_INCLUDE}/shcmd.h implicit
make include/nval.h implicit
make ${PACKAGE_ast_INCLUDE}/hash.h implicit
make ${PACKAGE_ast_INCLUDE}/hashpart.h implicit
done ${PACKAGE_ast_INCLUDE}/hashpart.h dontcare
done ${PACKAGE_ast_INCLUDE}/hash.h dontcare
prev ${PACKAGE_ast_INCLUDE}/option.h implicit
make ${PACKAGE_ast_INCLUDE}/cdt.h implicit
prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/bltins/getopts.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ int b_getopts(int argc,char *argv[],Shbltin_t *context)
error_info.context->flags |= ERROR_SILENT;
error_info.id = options;
options = argv[0];
np = nv_open(argv[1],sh.var_tree,NV_NOASSIGN|NV_VARNAME);
np = nv_open(argv[1],sh.var_tree,NV_VARNAME);
if(argc>2)
{
argv +=1;
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/bltins/mkservice.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ int b_mkservice(int argc, char** argv, Shbltin_t *context)
close(fd);
else
sp->fd = fd;
np = nv_open(var,sh.var_tree,NV_ARRAY|NV_VARNAME|NV_NOASSIGN);
np = nv_open(var,sh.var_tree,NV_ARRAY|NV_VARNAME);
sp->node = np;
nv_putval(np, path, 0);
nv_stack(np, (Namfun_t*)sp);
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/ksh93/bltins/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ static ssize_t fmtbase64(Sfio_t *iop, char *string, int alt)
char *cp;
Sfdouble_t d;
ssize_t size;
Namval_t *np = nv_open(string, NiL, NV_VARNAME|NV_NOASSIGN|NV_NOADD);
Namval_t *np = nv_open(string, NiL, NV_VARNAME|NV_NOADD);
Namarr_t *ap;
static union types_t number;
if(!np || nv_isnull(np))
Expand Down Expand Up @@ -795,7 +795,7 @@ static int extend(Sfio_t* sp, void* v, Sffmt_t* fe)
case 'n':
{
Namval_t *np;
np = nv_open(argp,sh.var_tree,NV_VARNAME|NV_NOASSIGN|NV_NOARRAY);
np = nv_open(argp,sh.var_tree,NV_VARNAME|NV_NOARRAY);
_nv_unset(np,0);
nv_onattr(np,NV_INTEGER);
if (np->nvalue.lp = new_of(int32_t,0))
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/bltins/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ int sh_readline(char **names, volatile int fd, int flags, ssize_t size, long tim
{
if(name)
{
np = nv_open(name,sh.var_tree,NV_NOASSIGN|NV_VARNAME);
np = nv_open(name,sh.var_tree,NV_VARNAME);
name = *++names;
}
else
Expand Down
12 changes: 6 additions & 6 deletions src/cmd/ksh93/bltins/typeset.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,12 +529,12 @@ int b_typeset(int argc,register char *argv[],Shbltin_t *context)
if(NV_CLASS[sizeof(NV_CLASS)-2]!='.')
sfputc(stkp,'.');
sfputr(stkp,tdata.prefix,0);
tdata.tp = nv_open(stkptr(stkp,offset),sh.var_tree,NV_VARNAME|NV_NOARRAY|NV_NOASSIGN);
tdata.tp = nv_open(stkptr(stkp,offset),sh.var_tree,NV_VARNAME|NV_NOARRAY);
#if SHOPT_NAMESPACE
if(!tdata.tp && off)
{
*stkptr(stkp,off)=0;
tdata.tp = nv_open(stkptr(stkp,offset),sh.var_tree,NV_VARNAME|NV_NOARRAY|NV_NOASSIGN);
tdata.tp = nv_open(stkptr(stkp,offset),sh.var_tree,NV_VARNAME|NV_NOARRAY);
}
#endif /* SHOPT_NAMESPACE */
stkseek(stkp,offset);
Expand Down Expand Up @@ -699,7 +699,7 @@ static int setall(char **argv,register int flag,Dt_t *troot,struct tdata *tp
}
#if SHOPT_NAMESPACE
if(sh.namespace)
np = sh_fsearch(name,NV_ADD|HASH_NOSCOPE);
np = sh_fsearch(name,NV_ADD|NV_NOSCOPE);
else
#endif /* SHOPT_NAMESPACE */
np = nv_open(name,sh_subfuntree(1),NV_NOARRAY|NV_IDENT|NV_NOSCOPE);
Expand All @@ -714,7 +714,7 @@ static int setall(char **argv,register int flag,Dt_t *troot,struct tdata *tp
#if SHOPT_NAMESPACE
np = 0;
if(sh.namespace)
np = sh_fsearch(name,HASH_NOSCOPE);
np = sh_fsearch(name,NV_NOSCOPE);
if(!np)
#endif /* SHOPT_NAMESPACE */
{
Expand Down Expand Up @@ -761,7 +761,7 @@ static int setall(char **argv,register int flag,Dt_t *troot,struct tdata *tp
/* tracked alias */
if(troot==sh.track_tree && tp->aflag=='-')
{
np = nv_search(name,troot,NV_ADD|HASH_NOSCOPE);
np = nv_search(name,troot,NV_ADD|NV_NOSCOPE);
path_alias(np,path_absolute(nv_name(np),NIL(Pathcomp_t*),0));
continue;
}
Expand Down Expand Up @@ -1349,7 +1349,7 @@ static int unall(int argc, char **argv, register Dt_t *troot)
{
#if SHOPT_NAMESPACE
if(sh.namespace && troot!=sh.var_tree)
np = sh_fsearch(name,nflag?HASH_NOSCOPE:0);
np = sh_fsearch(name,nflag);
if(!np)
#endif /* SHOPT_NAMESPACE */
np=nv_open(name,troot,NV_NOADD|nflag);
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/edit/completion.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ int ed_macro(Edit_t *ep, register int i)
ep->e_macro[2] = ed_getchar(ep,1);
else
ep->e_macro[2] = 0;
if (isalnum(i)&&(np=nv_search(ep->e_macro,sh.alias_tree,HASH_SCOPE))&&(out=nv_getval(np)))
if (isalnum(i)&&(np=nv_search(ep->e_macro,sh.alias_tree,0))&&(out=nv_getval(np)))
{
#if SHOPT_MULTIBYTE
/* copy to buff in internal representation */
Expand Down
1 change: 0 additions & 1 deletion src/cmd/ksh93/include/name.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ struct Ufunction
#define NV_TYPE 0x1000000
#define NV_STATIC 0x2000000
#define NV_COMVAR 0x4000000
#define NV_UNATTR 0x800000 /* unset attributes before assignment */
#define NV_FUNCTION (NV_RJUST|NV_FUNCT) /* value is shell function */
#define NV_FPOSIX NV_LJUST /* POSIX function semantics */
#define NV_FTMP NV_ZFILL /* function source in tmpfile */
Expand Down
3 changes: 1 addition & 2 deletions src/cmd/ksh93/include/nval.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <ast.h>
#include <cdt.h>
#include <option.h>
#include <hash.h>

typedef struct Namval Namval_t;
typedef struct Namfun Namfun_t;
Expand Down Expand Up @@ -174,7 +173,6 @@ struct Namval
#define NV_ADD 8
/* add node if not found */
#define NV_ASSIGN NV_NOFREE /* assignment is possible */
#define NV_NOASSIGN 0 /* backward compatibility */
#define NV_NOARRAY 0x200000 /* array name not possible */
#define NV_IARRAY 0x400000 /* for indexed array */
#define NV_NOREF NV_REF /* don't follow reference */
Expand All @@ -184,6 +182,7 @@ struct Namval
#define NV_NOSCOPE 0x80000 /* look only in current scope */
#define NV_NOFAIL 0x100000 /* return 0 on failure, no msg */
#define NV_NODISC NV_IDENT /* ignore disciplines */
#define NV_UNATTR 0x800000 /* unset attributes before assignment */
#define NV_GLOBAL 0x20000000 /* create global variable, ignoring local scope */

#define NV_FUNCT NV_IDENT /* option for nv_create */
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/include/shell.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*
*/

#define SH_VERSION 20220106
#define SH_VERSION 20220719

#include <ast.h>
#include <cdt.h>
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/sh/args.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ int sh_argopts(int argc,register char *argv[])
switch(n)
{
case 'A':
np = nv_open(opt_info.arg,sh.var_tree,NV_NOASSIGN|NV_ARRAY|NV_VARNAME);
np = nv_open(opt_info.arg,sh.var_tree,NV_ARRAY|NV_VARNAME);
if(f)
nv_unset(np);
continue;
Expand Down
8 changes: 4 additions & 4 deletions src/cmd/ksh93/sh/arith.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static Namval_t *scope(register Namval_t *np,register struct lval *lvalue,int as
Dt_t *sdict = (sh.st.real_fun? sh.st.real_fun->sdict:0);
Dt_t *nsdict = (sh.namespace?nv_dict(sh.namespace):0);
Dt_t *root = sh.var_tree;
assign = assign?NV_ASSIGN:NV_NOASSIGN;
assign = assign?NV_ASSIGN:0;
lvalue->nosub = 0;
if(nosub<0 && lvalue->ovalue)
return((Namval_t*)lvalue->ovalue);
Expand Down Expand Up @@ -101,9 +101,9 @@ static Namval_t *scope(register Namval_t *np,register struct lval *lvalue,int as
}
if((lvalue->emode & ARITH_COMP) && dtvnext(root))
{
if(mp = nv_search(cp, sdict ? sdict : root, HASH_NOSCOPE|HASH_SCOPE|HASH_BUCKET))
if(mp = nv_search(cp, sdict ? sdict : root, NV_NOSCOPE|NV_REF))
np = mp;
else if(nsdict && (mp = nv_search(cp, nsdict, HASH_SCOPE|HASH_BUCKET)))
else if(nsdict && (mp = nv_search(cp, nsdict, NV_REF)))
np = mp;
}
while(nv_isref(np))
Expand Down Expand Up @@ -365,7 +365,7 @@ static Sfdouble_t arith(const char **ptr, struct lval *lvalue, int type, Sfdoubl
np = &NaNnod;
nv_onattr(np,NV_NOFREE|NV_LDOUBLE|NV_RDONLY);
}
else if(!(np = nv_open(*ptr,root,NV_NOREF|NV_NOASSIGN|NV_VARNAME|dot)))
else if(!(np = nv_open(*ptr,root,NV_NOREF|NV_VARNAME|dot)))
{
lvalue->value = (char*)*ptr;
lvalue->flag = str-lvalue->value;
Expand Down
6 changes: 3 additions & 3 deletions src/cmd/ksh93/sh/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -1744,9 +1744,9 @@ void *nv_associative(register Namval_t *np,const char *sp,int mode)
return(0);
type = nv_isattr(np,NV_PUBLIC&~(NV_ARRAY|NV_CHILD|NV_MINIMAL));
if(mode)
mode = NV_ADD|HASH_NOSCOPE;
mode = NV_ADD|NV_NOSCOPE;
else if(ap->header.nelem&ARRAY_NOSCOPE)
mode = HASH_NOSCOPE;
mode = NV_NOSCOPE;
if(*sp==0 && sh_isoption(SH_XTRACE) && (mode&NV_ADD))
errormsg(SH_DICT,ERROR_warn(0),"adding empty subscript");
if(sh.subshell && (mp=nv_search(sp,ap->header.table,0)) && nv_isnull(mp))
Expand Down Expand Up @@ -1781,7 +1781,7 @@ void *nv_associative(register Namval_t *np,const char *sp,int mode)
ap->nextpos = (Namval_t*)dtnext(ap->header.table,mp);
}
else if(!mp && *sp && mode==0)
mp = nv_search(sp,ap->header.table,NV_ADD|HASH_NOSCOPE);
mp = nv_search(sp,ap->header.table,NV_ADD|NV_NOSCOPE);
np = mp;
if(ap->pos && ap->pos==np)
ap->header.nelem |= ARRAY_SCAN;
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/sh/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ int sh_redirect(struct ionod *iop, int flag)
np = 0;
if(iop->iovname)
{
np = nv_open(iop->iovname,sh.var_tree,NV_NOASSIGN|NV_VARNAME);
np = nv_open(iop->iovname,sh.var_tree,NV_VARNAME);
if(nv_isattr(np,NV_RDONLY))
{
errormsg(SH_DICT,ERROR_exit(1),e_readonly, nv_name(np));
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/sh/lex.c
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,7 @@ int sh_lex(Lex_t* lp)
/* check for aliases */
Namval_t* np;
if(!lp->lex.incase && !assignment && fcpeek(0)!=LPAREN &&
(np=nv_search(state,sh.alias_tree,HASH_SCOPE))
(np=nv_search(state,sh.alias_tree,0))
&& !nv_isattr(np,NV_NOEXPAND)
&& (lp->aliasok!=2 || nv_isattr(np,BLT_DCL))
&& (!sh_isstate(SH_NOALIAS) || nv_isattr(np,NV_NOFREE))
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/sh/macro.c
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ static int varsub(Mac_t *mp)
}
goto nosub;
}
flag |= NV_NOASSIGN|NV_VARNAME|NV_NOADD;
flag |= NV_VARNAME|NV_NOADD;
if(c=='=' || c=='?' || (c==':' && ((d=fcpeek(0))=='=' || d=='?')))
{
if(c=='=' || (c==':' && d=='='))
Expand Down
22 changes: 11 additions & 11 deletions src/cmd/ksh93/sh/name.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ void nv_setlist(register struct argnod *arg,register int flags, Namval_t *typ)
*eqp = '\0';
if((np = nv_search(cp,dtvnext(vartree),0)) && np->nvflag)
{
mp = nv_search(cp,vartree,NV_ADD|HASH_NOSCOPE);
mp = nv_search(cp,vartree,NV_ADD|NV_NOSCOPE);
mp->nvname = np->nvname; /* put_lang() (init.c) compares nvname pointers */
mp->nvflag = np->nvflag;
mp->nvsize = np->nvsize;
Expand Down Expand Up @@ -785,7 +785,7 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
dp->last = cp;
mode = (c=='.' || (flags&NV_NOADD))?add:NV_ADD;
if(level++ || ((flags&NV_NOSCOPE) && c!='.'))
mode |= HASH_NOSCOPE;
mode |= NV_NOSCOPE;
np=0;
if(top)
{
Expand All @@ -806,7 +806,7 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
#endif /* SHOPT_NAMESPACE */
{
#if SHOPT_NAMESPACE
if(!(nq = nv_search((char*)np,sh.var_base,HASH_BUCKET)))
if(!(nq = nv_search((char*)np,sh.var_base,NV_REF)))
#endif /* SHOPT_NAMESPACE */
nq = np;
sh.last_root = sh.var_tree->walk;
Expand Down Expand Up @@ -839,7 +839,7 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
np = 0;
}
if(!np || sh.var_tree->walk!=root)
np = nv_search(name,root,HASH_NOSCOPE|NV_ADD);
np = nv_search(name,root,NV_NOSCOPE|NV_ADD);
}
}
#if SHOPT_NAMESPACE
Expand Down Expand Up @@ -1026,7 +1026,7 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
{
int n = 0;
sub = 0;
mode &= ~HASH_NOSCOPE;
mode &= ~NV_NOSCOPE;
if(c=='[')
{
#if SHOPT_FIXEDARRAY
Expand Down Expand Up @@ -1343,7 +1343,7 @@ Namval_t *nv_open(const char *name, Dt_t *root, int flags)
{
long mode = ((flags&NV_NOADD)?0:NV_ADD);
if(flags&NV_NOSCOPE)
mode |= HASH_SCOPE|HASH_NOSCOPE;
mode |= NV_NOSCOPE;
np = nv_search(name,root,mode);
if(np && !(flags&NV_REF))
{
Expand Down Expand Up @@ -1443,7 +1443,7 @@ Namval_t *nv_open(const char *name, Dt_t *root, int flags)
#endif
if(fname)
{
c = ((flags&NV_NOSCOPE)?HASH_NOSCOPE:0)|((flags&NV_NOADD)?0:NV_ADD);
c = (flags&NV_NOSCOPE)|((flags&NV_NOADD)?0:NV_ADD);
*fname = '.';
np = nv_search(name, funroot, c);
*fname = 0;
Expand Down Expand Up @@ -1510,7 +1510,7 @@ Namval_t *nv_open(const char *name, Dt_t *root, int flags)
{
if(mp=nv_opensub(np))
np = mp;
else if(!array_assoc(ap) && (mp = nv_open(cp,sh.var_tree,NV_NOFAIL|NV_VARNAME|NV_NOARRAY|NV_NOASSIGN|NV_NOADD)) && nv_isvtree(np))
else if(!array_assoc(ap) && (mp = nv_open(cp,sh.var_tree,NV_NOFAIL|NV_VARNAME|NV_NOARRAY|NV_NOADD)) && nv_isvtree(np))
{
ap->nelem |= ARRAY_TREE;
nv_putsub(np,(char*)0,ARRAY_ADD|nv_aindex(np));
Expand All @@ -1524,7 +1524,7 @@ Namval_t *nv_open(const char *name, Dt_t *root, int flags)
nv_putval(np, cp, c);
if(isref)
{
if(nv_search((char*)np,sh.var_base,HASH_BUCKET))
if(nv_search((char*)np,sh.var_base,NV_REF))
sh.last_root = sh.var_base;
nv_setref(np,(Dt_t*)0,NV_VARNAME);
}
Expand Down Expand Up @@ -2260,7 +2260,7 @@ void nv_rehash(register Namval_t *np,void *data)
if(sh.subshell)
{
/* invalidate subshell node; if none exists, add a dummy */
np = nv_search(nv_name(np),sh.track_tree,NV_ADD|HASH_NOSCOPE);
np = nv_search(nv_name(np),sh.track_tree,NV_ADD|NV_NOSCOPE);
}
nv_onattr(np,NV_NOALIAS);
}
Expand Down Expand Up @@ -3369,7 +3369,7 @@ void nv_setref(register Namval_t *np, Dt_t *hp, int flags)
UNREACHABLE();
}
/* bind to earlier scope, or add to global scope */
if(!(hp=dtvnext(hp)) || (nq=nv_search((char*)np,hp,NV_ADD|HASH_BUCKET))==np)
if(!(hp=dtvnext(hp)) || (nq=nv_search((char*)np,hp,NV_ADD|NV_REF))==np)
{
errormsg(SH_DICT,ERROR_exit(1),e_selfref,nv_name(np));
UNREACHABLE();
Expand Down
21 changes: 16 additions & 5 deletions src/cmd/ksh93/sh/nvdisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,13 +941,24 @@ int nv_clone(Namval_t *np, Namval_t *mp, int flags)
return(1);
}

/*
* Low-level function to look up <name> in <root>. Returns a pointer to the
* name-value node found, or NULL if not found. <mode> is an options bitmask:
* - If NV_NOSCOPE is set, the search is only done in <root> itself and
* not in any trees it has a view to (i.e. is connected to through scoping).
* - If NV_ADD is set and <name> is not fond, a node by that name is created
* in <root> and a pointer to the newly created node is returned.
* - If NV_REF is set, <name> is a pointer to a name-value node, and that
* node's name is used.
* Note: The mode bitmask is NOT compatible with nv_open's flags bitmask.
*/
Namval_t *nv_search(const char *name, Dt_t *root, int mode)
{
register Namval_t *np;
register Dt_t *dp = 0;
if(mode&HASH_NOSCOPE)
if(mode&NV_NOSCOPE)
dp = dtview(root,0);
if(mode&HASH_BUCKET)
if(mode&NV_REF)
{
Namval_t *mp = (void*)name;
if(!(np = dtsearch(root,mp)) && (mode&NV_ADD))
Expand All @@ -961,9 +972,9 @@ Namval_t *nv_search(const char *name, Dt_t *root, int mode)
}
if(!np && (mode&NV_ADD))
{
if(sh.namespace && !(mode&HASH_NOSCOPE) && root==sh.var_tree)
if(sh.namespace && !(mode&NV_NOSCOPE) && root==sh.var_tree)
root = nv_dict(sh.namespace);
else if(!dp && !(mode&HASH_NOSCOPE))
else if(!dp && !(mode&NV_NOSCOPE))
{
register Dt_t *next;
while(next=dtvnext(root))
Expand Down Expand Up @@ -1025,7 +1036,7 @@ Namval_t *nv_bfsearch(const char *name, Dt_t *root, Namval_t **var, char **last)
*last = cp;
c = *cp;
*cp = 0;
nq=nv_open(stakptr(offset),0,NV_VARNAME|NV_NOASSIGN|NV_NOADD|NV_NOFAIL);
nq=nv_open(stakptr(offset),0,NV_VARNAME|NV_NOADD|NV_NOFAIL);
*cp = c;
if(!nq)
{
Expand Down
Loading

0 comments on commit 1884f57

Please sign in to comment.