diff options
author | Mark Bainter <mbainter+github@gmail.com> | 2015-04-20 15:28:37 +0000 |
---|---|---|
committer | Mark Bainter <mbainter+github@gmail.com> | 2015-05-06 21:34:19 -0500 |
commit | c55e488079d3629fbfe16580262cd9a6f3d5eeae (patch) | |
tree | 4652af8c5e68591a3527d42ab6f0350060d3b8b6 /src/nvim/path.c | |
parent | 477b6a2c447dc10c068b13aab9a533a51c3284af (diff) | |
download | rneovim-c55e488079d3629fbfe16580262cd9a6f3d5eeae.tar.gz rneovim-c55e488079d3629fbfe16580262cd9a6f3d5eeae.tar.bz2 rneovim-c55e488079d3629fbfe16580262cd9a6f3d5eeae.zip |
Remove char_u: concat_fnames()
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r-- | src/nvim/path.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c index 3d1d1629dc..9ceccb8ebd 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -329,20 +329,25 @@ int vim_fnamencmp(char_u *x, char_u *y, size_t len) #endif } -/* - * Concatenate file names fname1 and fname2 into allocated memory. - * Only add a '/' or '\\' when 'sep' is TRUE and it is necessary. - */ -char_u *concat_fnames(char_u *fname1, char_u *fname2, int sep) - FUNC_ATTR_NONNULL_RET +/// Concatenate file names fname1 and fname2 into allocated memory. +/// +/// Only add a '/' or '\\' when 'sep' is true and it is necessary. +/// +/// @param fname1 is the first part of the path or filename +/// @param fname2 is the second half of the path or filename +/// @param sep is a flag to indicate a path separator should be added +/// if necessary +/// @return [allocated] Concatenation of fname1 and fname2. +char *concat_fnames(const char *fname1, const char *fname2, bool sep) + FUNC_ATTR_NONNULL_ARG(1, 2) FUNC_ATTR_NONNULL_RET { - char_u *dest = xmalloc(STRLEN(fname1) + STRLEN(fname2) + 3); + char *dest = xmalloc(strlen(fname1) + strlen(fname2) + 3); - STRCPY(dest, fname1); + strcpy(dest, fname1); if (sep) { - add_pathsep((char *)dest); + add_pathsep(dest); } - STRCAT(dest, fname2); + strcat(dest, fname2); return dest; } |