From aa7218b646e52554621471df3668c2e1d95aa9c9 Mon Sep 17 00:00:00 2001 From: John Date: Sun, 6 Apr 2014 23:54:19 +0200 Subject: Move and adapt `os_get_absolute_path` unit tests to `vim_FullName` * Add two new unit tests to `vim_FullName` * Make `os_get_absolute_path` static --- src/path.c | 10 +++++++++- src/path.h | 9 --------- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/path.c b/src/path.c index 348ff05d69..b63fd28cf4 100644 --- a/src/path.c +++ b/src/path.c @@ -30,6 +30,7 @@ #define URL_SLASH 1 /* path_is_url() has found "://" */ #define URL_BACKSLASH 2 /* path_is_url() has found ":\\" */ +static int os_get_absolute_path(char_u *fname, char_u *buf, int len, int force); static bool is_executable(const char_u *name); static bool is_executable_in_path(const char_u *name); @@ -2023,7 +2024,14 @@ int append_path(char *path, const char *to_append, int max_len) return OK; } -int os_get_absolute_path(char_u *fname, char_u *buf, int len, int force) +/// Expand a given file to its absolute path. +/// +/// @param fname The filename which should be expanded. +/// @param buf Buffer to store the absolute path of `fname`. +/// @param len Length of `buf`. +/// @param force Also expand when `fname` is already absolute. +/// @return `FAIL` for failure, `OK` for success. +static int os_get_absolute_path(char_u *fname, char_u *buf, int len, int force) { char_u *p; *buf = NUL; diff --git a/src/path.h b/src/path.h index 07451ec4c9..ebd773ab18 100644 --- a/src/path.h +++ b/src/path.h @@ -97,15 +97,6 @@ int os_full_dir_name(char *directory, char *buffer, int len); // Append to_append to path with a slash in between. int append_path(char *path, const char *to_append, int max_len); -/// Expand a given file to its absolute path. -/// -/// @param fname The filename which should be expanded. -/// @param buf Buffer to store the absolute path of `fname`. -/// @param len Length of `buf`. -/// @param force Also expand when `fname` is already absolute. -/// @return `FAIL` for failure, `OK` for success. -int os_get_absolute_path(char_u *fname, char_u *buf, int len, int force); - /// Check if the given file is absolute. /// /// This just checks if the file name starts with '/' or '~'. -- cgit