summaryrefslogtreecommitdiff
path: root/filesystem-posix.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-01-21 19:13:40 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-01-21 19:13:40 -0500
commit46a02444bdeac16474e31c4e836b118c07f8f57f (patch)
tree3b8079c0e19704c5c0c45ca838c84a35d4ad608c /filesystem-posix.c
parent8fca7beaf35cfc438d5d29f352f80dd18efe7d2e (diff)
trying to make clicking on directories work; not done yet
Diffstat (limited to 'filesystem-posix.c')
-rw-r--r--filesystem-posix.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/filesystem-posix.c b/filesystem-posix.c
index 1a23eff..ebf1407 100644
--- a/filesystem-posix.c
+++ b/filesystem-posix.c
@@ -69,3 +69,14 @@ int fs_mkdir(char const *path) {
return -1;
}
}
+
+int fs_get_cwd(char *buf, size_t buflen) {
+ assert(buf && buflen);
+ if (getcwd(buf, buflen)) {
+ return 1;
+ } else if (errno == ERANGE) {
+ return 0;
+ } else {
+ return -1;
+ }
+}