From 15c43613818a37ad4c454c55e763a0f3637d827e Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Mon, 21 Oct 2013 12:03:25 +0900 Subject: [PATCH] return #f if get-environment-variable refers undefined env-var --- src/system.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/system.c b/src/system.c index 04c38804..4b1ed99e 100644 --- a/src/system.c +++ b/src/system.c @@ -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