Re: wrong behaviour when unsetting/setting some variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2024-02-27 at 03:07 +0000, Harald van Dijk wrote:
> I suspect the reason you don't see it happen with TERM, LINENO, and 
> HISTSIZE is because you have built dash in a configuration in which 
> these variables are not special.

Ah, I see... well I merely took the Debian unstable version of it.


> For special variables, we get to
> 
>    flags |= vp->flags & ~(VTEXTFIXED|VSTACK|VNOSAVE|VUNSET);
> 
> where we preserve the VEXPORT of the previous value. In case of
> VUNSET, 
> we should not be doing that. I agree with your expectations, unset 
> should clear the export attribute.

So is it really just:
   --- a/src/var.c	2024-02-27 04:25:32.000000000 +0100
   +++ b/src/var.c	2024-02-27 04:22:40.744456151 +0100
   @@ -295,7 +295,7 @@
    			goto out;
    		}
    
   -		flags |= vp->flags & ~(VTEXTFIXED|VSTACK|VNOSAVE|VUNSET);
   +		flags |= vp->flags & ~(VEXPORT|VTEXTFIXED|VSTACK|VNOSAVE|VUNSET);
    	} else {
    		if (flags & VNOSET)
    			goto out;

I had even had that before, and it seemed to work, but wasn't really
sure whether it doesn't mess anything up behind the scenes which I
didn't understand.

If so, are you going to send a proper - or shall I?

Thanks,
Chris.





[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux