aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/paths.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdlib/paths.c')
-rw-r--r--src/stdlib/paths.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stdlib/paths.c b/src/stdlib/paths.c
index 86095f76..6b16916c 100644
--- a/src/stdlib/paths.c
+++ b/src/stdlib/paths.c
@@ -717,7 +717,8 @@ public List_t Path$glob(Path_t path)
public Path_t Path$current_dir(void)
{
char cwd[PATH_MAX];
- getcwd(cwd, sizeof(cwd));
+ if (getcwd(cwd, sizeof(cwd)) == NULL)
+ fail("Could not get current working directory");
return Path$from_str(cwd);
}