components/ksh93/patches/105-CR7032068.patch
changeset 5129 5431772f7235
parent 4305 90493abe0c5c
--- a/components/ksh93/patches/105-CR7032068.patch	Wed Nov 25 13:34:08 2015 -0800
+++ b/components/ksh93/patches/105-CR7032068.patch	Thu Nov 26 02:23:48 2015 -0800
@@ -1,7 +1,8 @@
-diff -rupN INIT.2011-02-08.clean/src/cmd/ksh93/sh/macro.c INIT.2011-02-08/src/cmd/ksh93/sh/macro.c
---- INIT.2011-02-08.clean/src/cmd/ksh93/sh/macro.c	2012-05-02 03:34:48.830258020 -0700
-+++ INIT.2011-02-08/src/cmd/ksh93/sh/macro.c	2012-05-02 03:42:51.584924888 -0700
-@@ -1084,7 +1084,7 @@ static int varsub(Mac_t *mp)
+This patch has been developed inhouse. This fixes a Solaris
+specific issue and has not been submitted to the community.
+--- INIT.2012-08-01.old/src/cmd/ksh93/sh/macro.c	2015-02-24 13:25:19.363200741 -0800
++++ INIT.2012-08-01/src/cmd/ksh93/sh/macro.c	2015-03-05 11:11:46.044880541 -0800
+@@ -1086,7 +1086,7 @@ static int varsub(Mac_t *mp)
  {
  	register int	c;
  	register int	type=0; /* M_xxx */
@@ -10,20 +11,25 @@
  	register Namval_t	*np = NIL(Namval_t*);
  	register int 	dolg=0, mode=0;
  	Lex_t		*lp = (Lex_t*)mp->shp->lex_context;
-@@ -1436,6 +1436,7 @@ retry1:
- 				if( (mp->arith||mp->let) && (np->nvfun || nv_isattr(np,(NV_LJUST|NV_RJUST|NV_ZFILL))) && !nv_isattr(np,NV_INTEGER) && (offset==0 || !isalnum(c)))
+@@ -1439,6 +1439,7 @@ retry1:
+ 				if((mp->let || (mp->arith&&nv_isattr(np,(NV_LJUST|NV_RJUST|NV_ZFILL)))) && !nv_isattr(np,NV_INTEGER) && (offset==0 || isspace(c) || strchr(",.+-*/=%&|^?!<>",c)))
  					mp->zeros = 1;
  			}
 +			new_v = v = strdup(v);
  			if(savptr==stakptr(0))
  				stkseek(stkp,offset);
  			else
-@@ -1963,8 +1964,12 @@ retry2:
+@@ -1989,6 +1990,8 @@ retry2:
  	}
  	if(np)
  		nv_close(np);
-+ 	if (new_v)
++	if (new_v)
 +		free(new_v);
+ 	if(pattern)
+ 		free(pattern);
+ 	if(repstr)
+@@ -1997,6 +2000,8 @@ retry2:
+ 		free(idx);
  	return(1);
  nosub:
 +	if (new_v)