Blame SOURCES/ksh-20120801-xufix.patch

0c842d
diff -up ksh-20120801/src/cmd/ksh93/bltins/typeset.c.xufix ksh-20120801/src/cmd/ksh93/bltins/typeset.c
0c842d
--- ksh-20120801/src/cmd/ksh93/bltins/typeset.c.xufix	2015-02-03 14:47:23.266022137 +0100
0c842d
+++ ksh-20120801/src/cmd/ksh93/bltins/typeset.c	2015-02-03 14:47:23.308022046 +0100
0c842d
@@ -93,6 +93,8 @@ int    b_readonly(int argc,char *argv[],
0c842d
 	memset((void*)&tdata,0,sizeof(tdata));
0c842d
 	tdata.sh = context->shp;
0c842d
 	tdata.aflag = '-';
0c842d
+	/* do not change size */
0c842d
+	tdata.argnum = -1;
0c842d
 	while((flag = optget(argv,*command=='e'?sh_optexport:sh_optreadonly))) switch(flag)
0c842d
 	{
0c842d
 		case 'p':
0c842d
diff -up ksh-20120801/src/cmd/ksh93/sh/name.c.xufix ksh-20120801/src/cmd/ksh93/sh/name.c
0c842d
--- ksh-20120801/src/cmd/ksh93/sh/name.c.xufix	2015-02-03 14:47:23.281022105 +0100
0c842d
+++ ksh-20120801/src/cmd/ksh93/sh/name.c	2015-02-03 14:52:08.768404194 +0100
0c842d
@@ -3019,10 +3019,12 @@ void nv_newattr (register Namval_t *np,
0c842d
 			nv_onattr(np,NV_EXPORT);
0c842d
 			sh_envput(shp->env,np);
0c842d
 		}
0c842d
-		if((n^newatts)==NV_EXPORT)
0c842d
+		if((n^newatts)==NV_EXPORT && size==-1)
0c842d
 			return;
0c842d
 	}
0c842d
 	oldsize = nv_size(np);
0c842d
+	if (size == -1)
0c842d
+		size = oldsize;
0c842d
 	if((size==oldsize|| (n&NV_INTEGER)) && !trans && ((n^newatts)&~NV_NOCHANGE)==0)
0c842d
 	{
0c842d
 		if(size)