Blame SOURCES/ksh-20120801-xufix.patch

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