mirror of
				git://git.code.sf.net/p/cdesktopenv/code
				synced 2025-03-09 15:50:02 +00:00 
			
		
		
		
	Revert 096f46ee ("Fix for memory mgmt in variable expansion")
				
					
				
			This reverts a Solaris patch (105-CR7032068) with no documentation on what it fixes or how or why. There are reports about it causing a crash and/or a regression: https://github.com/ksh93/ksh/issues/180#issuecomment-780980442
This commit is contained in:
		
							parent
							
								
									50b665b1ed
								
							
						
					
					
						commit
						8c2d8e5f46
					
				
					 1 changed files with 1 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -1079,7 +1079,7 @@ static int varsub(Mac_t *mp)
 | 
			
		|||
{
 | 
			
		||||
	register int	c;
 | 
			
		||||
	register int	type=0; /* M_xxx */
 | 
			
		||||
	register char	*v, *new_v=0, *argp=0;
 | 
			
		||||
	register char	*v,*argp=0;
 | 
			
		||||
	register Namval_t	*np = NIL(Namval_t*);
 | 
			
		||||
	register int 	dolg=0, mode=0;
 | 
			
		||||
	Lex_t		*lp = (Lex_t*)mp->shp->lex_context;
 | 
			
		||||
| 
						 | 
				
			
			@ -1458,7 +1458,6 @@ 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
 | 
			
		||||
| 
						 | 
				
			
			@ -2027,8 +2026,6 @@ retry2:
 | 
			
		|||
	}
 | 
			
		||||
	if(np)
 | 
			
		||||
		nv_close(np);
 | 
			
		||||
	if(new_v)
 | 
			
		||||
		free(new_v);
 | 
			
		||||
	if(pattern)
 | 
			
		||||
		free(pattern);
 | 
			
		||||
	if(repstr)
 | 
			
		||||
| 
						 | 
				
			
			@ -2037,8 +2034,6 @@ retry2:
 | 
			
		|||
		free(idx);
 | 
			
		||||
	return(1);
 | 
			
		||||
nosub:
 | 
			
		||||
	if(new_v)
 | 
			
		||||
		free(new_v);
 | 
			
		||||
	if(type==M_BRACE && sh_lexstates[ST_NORM][c]==S_BREAK)
 | 
			
		||||
	{
 | 
			
		||||
		fcseek(-1);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue