diff options
Diffstat (limited to 'filesystem-win.c')
-rw-r--r-- | filesystem-win.c | 12 |
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; + } +} |