Return #f when no path is found

Return `SCM_BOOL_F' when `realpath' can't find the path.
This commit is contained in:
Tom Willemsen 2012-09-18 19:35:54 +02:00
parent d47e68fe21
commit 963c85b479

View file

@ -26,7 +26,10 @@ SCM_DEFINE(realpath_wrapper, "realpath", 1, 0, 0,
{
char *relative_path = scm_to_locale_string(path);
char *resolved_path = realpath(relative_path, NULL);
SCM scm_resolved_path = scm_from_locale_string(resolved_path);
SCM scm_resolved_path = SCM_BOOL_F;
if (resolved_path)
scm_resolved_path = scm_from_locale_string(resolved_path);
free(relative_path);
free(resolved_path);