|
|
1a53a7 |
diff -up ksh-20120801/src/cmd/ksh93/sh/array.c.memlik ksh-20120801/src/cmd/ksh93/sh/array.c
|
|
|
1a53a7 |
--- ksh-20120801/src/cmd/ksh93/sh/array.c.memlik 2012-06-07 00:00:42.000000000 +0200
|
|
|
1a53a7 |
+++ ksh-20120801/src/cmd/ksh93/sh/array.c 2013-06-11 16:52:47.557123973 +0200
|
|
|
1a53a7 |
@@ -1701,7 +1701,11 @@ void *nv_associative(register Namval_t *
|
|
|
1a53a7 |
ap->header.scope = 0;
|
|
|
1a53a7 |
}
|
|
|
1a53a7 |
else
|
|
|
1a53a7 |
- dtclose(ap->header.table);
|
|
|
1a53a7 |
+ {
|
|
|
1a53a7 |
+ if((ap->header.nelem&ARRAY_MASK)==0 && (ap->cur=nv_search("0",ap->header.table,0)))
|
|
|
1a53a7 |
+ nv_associative(np,(char*)0,NV_ADELETE);
|
|
|
1a53a7 |
+ dtclose(ap->header.table);
|
|
|
1a53a7 |
+ }
|
|
|
1a53a7 |
return((void*)ap);
|
|
|
1a53a7 |
case NV_ANEXT:
|
|
|
1a53a7 |
if(!ap->pos)
|
|
|
1a53a7 |
diff -up ksh-20120801/src/cmd/ksh93/sh/name.c.memlik ksh-20120801/src/cmd/ksh93/sh/name.c
|
|
|
1a53a7 |
--- ksh-20120801/src/cmd/ksh93/sh/name.c.memlik 2012-07-23 18:21:57.000000000 +0200
|
|
|
1a53a7 |
+++ ksh-20120801/src/cmd/ksh93/sh/name.c 2013-06-11 16:19:41.036648218 +0200
|
|
|
1a53a7 |
@@ -2465,6 +2465,8 @@ static void table_unset(Shell_t *shp, re
|
|
|
1a53a7 |
}
|
|
|
1a53a7 |
}
|
|
|
1a53a7 |
npnext = (Namval_t*)dtnext(root,np);
|
|
|
1a53a7 |
+ if(nv_arrayptr(np))
|
|
|
1a53a7 |
+ nv_putsub(np,NIL(char*),ARRAY_SCAN);
|
|
|
1a53a7 |
_nv_unset(np,flags);
|
|
|
1a53a7 |
nv_delete(np,root,0);
|
|
|
1a53a7 |
}
|
|
|
1a53a7 |
@@ -3326,7 +3328,7 @@ int nv_rename(register Namval_t *np, int
|
|
|
1a53a7 |
shp->last_root = last_root;
|
|
|
1a53a7 |
if(flags&NV_MOVE)
|
|
|
1a53a7 |
{
|
|
|
1a53a7 |
- if(arraynp && !nv_isattr(np,NV_MINIMAL) && (mp=(Namval_t*)np->nvenv) && (ap=nv_arrayptr(mp)))
|
|
|
1a53a7 |
+ if(arraynp && !nv_isattr(np,NV_MINIMAL) && (mp=(Namval_t*)np->nvenv) && (ap=nv_arrayptr(mp)) && !ap->fun)
|
|
|
1a53a7 |
ap->nelem++;
|
|
|
1a53a7 |
}
|
|
|
1a53a7 |
if((nv_arrayptr(nr) && !arraynr) || nv_isvtree(nr))
|