diff options
Diffstat (limited to 'src/os/fs.c')
-rw-r--r-- | src/os/fs.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/os/fs.c b/src/os/fs.c index 358b07e57b..e9a76c6b79 100644 --- a/src/os/fs.c +++ b/src/os/fs.c @@ -23,3 +23,17 @@ int mch_chdir(char *path) { } return uv_chdir(path); } + +/* + * Get name of current directory into buffer 'buf' of length 'len' bytes. + * Return OK for success, FAIL for failure. + */ +int mch_dirname(char_u *buf, int len) +{ + int errno; + if ((errno = uv_cwd((char *)buf, len)) != 0) { + STRCPY(buf, uv_strerror(errno)); + return FAIL; + } + return OK; +} |