From 963c85b479607464b2834655c196ec520fcca30d Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Tue, 18 Sep 2012 19:35:54 +0200 Subject: Return #f when no path is found Return `SCM_BOOL_F' when `realpath' can't find the path. --- src/gitto-path.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gitto-path.c b/src/gitto-path.c index 4fdd6ab..7ed5f51 100644 --- a/src/gitto-path.c +++ b/src/gitto-path.c @@ -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); -- cgit v1.2.3-54-g00ecf