return #f if get-environment-variable refers undefined env-var

This commit is contained in:
Yuichi Nishiwaki 2013-10-21 12:03:25 +09:00
parent adab797391
commit 15c4361381
1 changed files with 4 additions and 1 deletions

View File

@ -31,7 +31,10 @@ pic_system_getenv(pic_state *pic)
val = getenv(str);
return pic_str_new_cstr(pic, val);
if (val == NULL)
return pic_nil_value();
else
return pic_str_new_cstr(pic, val);
}
static pic_value