2011-05-12 10:24:54 -05:00
|
|
|
fn getenv(str n) -> option::t[str] {
|
2011-05-17 13:41:41 -05:00
|
|
|
auto s = os::libc::getenv(str::buf(n));
|
2011-05-20 19:56:14 -05:00
|
|
|
ret if ((s as int) == 0) {
|
|
|
|
option::none[str]
|
2011-05-12 10:24:54 -05:00
|
|
|
} else {
|
2011-05-20 19:56:14 -05:00
|
|
|
option::some[str](str::str_from_cstr(s))
|
|
|
|
};
|
2011-05-12 10:24:54 -05:00
|
|
|
}
|
|
|
|
|