From 893c6a9068561939b95b39037b81d669944f1864 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Sat, 20 Nov 2021 05:57:07 +0100 Subject: [PATCH] nv_associative(): clarify value indicating enum (re: 6b9703ff) --- src/cmd/ksh93/sh/array.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cmd/ksh93/sh/array.c b/src/cmd/ksh93/sh/array.c index 01b15560c..3ea839204 100644 --- a/src/cmd/ksh93/sh/array.c +++ b/src/cmd/ksh93/sh/array.c @@ -1777,12 +1777,11 @@ void *nv_associative(register Namval_t *np,const char *sp,int mode) if(sh.subshell) np = sh_assignok(np,1); /* - * type == 0x26 == NV_INTEGER|NV_LTOU|NV_RJUST (see include/nval.h) indicates an + * type == NV_UINT16 (16-bit unsigned integer, see include/nval.h) indicates an * associative array of a type created by the enum command. nelem should not be * increased in that case or 'unset' will fail to completely unset such an array. */ - if(type != (NV_INTEGER|NV_LTOU|NV_RJUST) - && (!ap->header.scope || !nv_search(sp,dtvnext(ap->header.table),0))) + if(type != NV_UINT16 && (!ap->header.scope || !nv_search(sp,dtvnext(ap->header.table),0))) ap->header.nelem++; if(nv_isnull(mp)) {