Skip Tavakkolian <9...@9netics.com> said:

> > but both
> > of the hard-coded paths in 9vx main.c are obviously in RSC's home 
> > directories
> 
> it's not hardcoded; 

What?  The findroot code reads:

static char*
findroot(void)
{
        static char cwd[1024];
        int i;
        char buf[1024];
        char *dir[] = {
                cwd,
                "/Users/rsc/9vx",
                "/home/rsc/plan9/4e"
        };
        
        if(getcwd(cwd, sizeof cwd) == nil){
                oserrstr();
                panic("getcwd: %r");
        }

        for(i=0; i<nelem(dir); i++){
                snprint(buf, sizeof buf, "%s/386/bin/rc", dir[i]);
                if(access(buf, 0) >= 0)
                        return dir[i];
        }
        return nil;
}

"/Users/rsc/9vx","/home/rsc/plan9/4e" are most certainly hard coded locations,
and will likely only be default on rsc's machines.  

> you can use -r as Russ said.  the difference is:
> "use default unless -r is given" vs.  "use default unless
> getenv(NINEROOT) is given".  -r makes it very obvious what the root is
> and probably will work better for un-unix-like environments.

Put another way, what are the default locations? 

Also, it would probably be "use default unless getenv(NINEROOT) or -r is
given".  Also, getenv works on Windoz.  What un-unix-like environments are you
referring to?

> but at any rate, you have the sources and are free to change things
> locally to suit your taste.

true, but will these patches be accepted upstream?  If I was looking to just
build this for myself I would not be bothering any of you, I'm trying to
figure out what would be useful to include upstream.  I guess I should not
have posted this to the list, but simply taken it up with Russ off-list since
it is his code.

  EBo --



Reply via email to