summaryrefslogtreecommitdiff
path: root/filesystem-win.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-win.c
parent8fca7beaf35cfc438d5d29f352f80dd18efe7d2e (diff)
trying to make clicking on directories work; not done yet
Diffstat (limited to 'filesystem-win.c')
-rw-r--r--filesystem-win.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/filesystem-win.c b/filesystem-win.c
index 7c40820..d35597f 100644
--- a/filesystem-win.c
+++ b/filesystem-win.c
@@ -65,3 +65,15 @@ int fs_mkdir(char const *path) {
return -1; // some other error
}
}
+
+int fs_get_cwd(char *buf, size_t buflen) {
+ assert(buf && buflen);
+ DWORD pathlen = GetCurrentDirectory(buflen, buf);
+ if (pathlen == 0) {
+ return -1;
+ } else if (pathlen < buflen) { // it's confusing, but this is < and not <=
+ return 1;
+ } else {
+ return 0;
+ }
+}