* 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.
This commit is contained in:
parent
85e02c55a9
commit
9373b38711
2 changed files with 7 additions and 11 deletions
|
|
@ -1,3 +1,9 @@
|
|||
Tue Dec 10 23:38:43 1996 Gary Houston <ghouston@actrix.gen.nz>
|
||||
|
||||
* 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.
|
||||
|
||||
Mon Dec 9 23:23:35 1996 Tom Tromey <tromey@cygnus.com>
|
||||
|
||||
* Makefile.am (.c.x): Use guile-snarf.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue