summaryrefslogtreecommitdiff
path: root/libguile/simpos.c
diff options
context:
space:
mode:
authorGary Houston <ghouston@arglist.com>1996-12-11 19:06:31 +0000
committerGary Houston <ghouston@arglist.com>1996-12-11 19:06:31 +0000
commit9373b38711cefaf265762df9208c351df8a27280 (patch)
tree56ddbbf680789b5f7e13e925e34ef9be82fe85dd /libguile/simpos.c
parent85e02c55a9f453aa7d079835cc2645859962512c (diff)
downloadguile-9373b38711cefaf265762df9208c351df8a27280.tar.gz
* simpos.c (scm_getenv): return #f if string can't be found in the
environment instead of throwing an exception, for compatibility with numerous other systems.
Diffstat (limited to 'libguile/simpos.c')
-rw-r--r--libguile/simpos.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/libguile/simpos.c b/libguile/simpos.c
index 57d5de19d..ee0f7a94d 100644
--- a/libguile/simpos.c
+++ b/libguile/simpos.c
@@ -90,17 +90,7 @@ scm_getenv(nam)
if (SCM_ROSTRINGP (nam))
nam = scm_makfromstr (SCM_ROCHARS (nam), SCM_ROLENGTH (nam), 0);
val = getenv(SCM_CHARS(nam));
- if (!val)
- {
- /* This isn't a system error (errno won't be set), but is still
- treated as an exceptional condition, since getenv normally
- returns a string. Can easily do (false-if-exception (getenv ...))
- to catch the exception.
- */
- scm_misc_error (s_getenv, "%S not found in environment",
- scm_listify (nam, SCM_UNDEFINED));
- }
- return scm_makfromstr(val, (scm_sizet)strlen(val), 0);
+ return (val) ? scm_makfromstr(val, (scm_sizet)strlen(val), 0) : SCM_BOOL_F;
}
#ifdef vms