plan9port/src/lib9/get9root.c

19 lines
216 B
C
Raw Normal View History

2004-03-25 23:08:53 +00:00
#include <u.h>
#include <libc.h>
char*
get9root(void)
{
2005-01-04 22:19:07 +00:00
static char *s;
if(s)
return s;
2004-03-25 23:08:53 +00:00
if((s = getenv("PLAN9")) != 0)
return s;
2005-01-04 22:19:07 +00:00
/* could do better - search $PATH */
s = "/usr/local/plan9";
return s;
2004-03-25 23:08:53 +00:00
}