path: learn save_absolute_path().

This commit is contained in:
Scott Prager 2014-09-17 00:57:27 -04:00
parent 8d6540f876
commit 899878d347

View File

@ -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)