mirror of
https://github.com/neovim/neovim.git
synced 2025-09-15 07:48:18 +00:00
path: learn save_absolute_path().
This commit is contained in:
@@ -390,6 +390,19 @@ FullName_save (
|
|||||||
return new_fname;
|
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(NO_EXPANDPATH) || defined(PROTO)
|
||||||
|
|
||||||
#if defined(UNIX) || defined(USE_UNIXFILENAME) || defined(PROTO)
|
#if defined(UNIX) || defined(USE_UNIXFILENAME) || defined(PROTO)
|
||||||
|
Reference in New Issue
Block a user