aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/path.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r--src/nvim/path.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c
index 4e05c506f8..f4806f5974 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -390,6 +390,19 @@ FullName_save (
return new_fname;
}
+/// Saves the absolute path.
+/// @param name An absolute or relative path.
+/// @return The absolute path of `name`.
+char_u *save_absolute_path(const char_u *name)
+ FUNC_ATTR_MALLOC FUNC_ATTR_NONNULL_RET FUNC_ATTR_NONNULL_ALL
+{
+ if (!path_is_absolute_path(name)) {
+ return FullName_save((char_u *) name, true);
+ }
+ return vim_strsave((char_u *) name);
+}
+
+
#if !defined(NO_EXPANDPATH) || defined(PROTO)
#if defined(UNIX) || defined(USE_UNIXFILENAME) || defined(PROTO)