DescriptionIn rc subshells, there might be two definitions of a
function fn#... of the same name in the environment.
To reproduce, type
fn a{echo a}
rc -c 'env | grep fn'
It will show fn#a twice.
In plan9ish.c's Vinit() rc will go through the environment
and add internal variables for each environment variable
found. It will also create variables named fn#..., i.e.
normal variables, not functions.
At another place, Xrdfn(), the fn#-style function
definitions are actually interpreted.
So in case an rc function already had been defined when
rc was started, mkenv() later will create two environment
entries "fn#a", one for the internal variable created
previously within Vinit(), and a second one for the
function definition, created in Xrdfn().
The patch prevents function definitions from being added
as internal variables in Vinit, similar as it is done in
Plan 9's rc.
[ Some lines down there is a sequnce
case '(': /* ignore functions for now */
break;
It seems that in the past it might have had a similar
purpose, but probably related to the Bourne shell ...
There is a corresponding place within an "#if 0" block
in Xrdfn. ]
Patch Set 1 #Patch Set 2 : The patch now contains the inverted test. #Patch Set 3 : The patch now contains the inverted test. #MessagesTotal messages: 4
|