From 0cdd992e06a090f1965045fade378579ea5ac05d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 5 Aug 2020 23:34:52 +0200 Subject: Add lilv_path_current() --- src/filesystem.c | 6 ++++++ src/filesystem.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/filesystem.c b/src/filesystem.c index 39ba2a2..4ba0bd9 100644 --- a/src/filesystem.c +++ b/src/filesystem.c @@ -114,6 +114,12 @@ lilv_path_is_child(const char* path, const char* dir) return false; } +char* +lilv_path_current(void) +{ + return getcwd(NULL, 0); +} + char* lilv_path_absolute(const char* path) { diff --git a/src/filesystem.h b/src/filesystem.h index 8971372..b43e394 100644 --- a/src/filesystem.h +++ b/src/filesystem.h @@ -29,6 +29,10 @@ lilv_path_is_absolute(const char* path); bool lilv_path_is_child(const char* path, const char* dir); +/// Return the current working directory +char* +lilv_path_current(void); + /** Return `path` as an absolute path. -- cgit v1.2.1