mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-27 11:52:03 +00:00
cache answer
This commit is contained in:
parent
66c10f02c3
commit
b94ad13d4b
1 changed files with 7 additions and 2 deletions
|
@ -4,10 +4,15 @@
|
|||
char*
|
||||
get9root(void)
|
||||
{
|
||||
char *s;
|
||||
static char *s;
|
||||
|
||||
if(s)
|
||||
return s;
|
||||
|
||||
if((s = getenv("PLAN9")) != 0)
|
||||
return s;
|
||||
return "/usr/local/plan9";
|
||||
/* could do better - search $PATH */
|
||||
s = "/usr/local/plan9";
|
||||
return s;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue