Blame SOURCES/ksh-20120801-xufix.patch

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