From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 12 Apr 2010 23:20:39 -0600 To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net>, "Skip Tavakkolian" <9nut@9netics.com> From: "EBo" Message-ID: In-Reply-To: References: Subject: Re: [9fans] 9vx patch to read environment var PLAN9 Topicbox-Message-UUID: 0096051c-ead6-11e9-9d60-3106f5b1d025 Skip Tavakkolian <9nut@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= 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 --