aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/path.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2015-04-12 02:48:34 -0400
committerJustin M. Keyes <justinkz@gmail.com>2015-04-12 02:48:34 -0400
commitecc28fb2dd43551f349a071f9597cf7033f306f7 (patch)
tree6168d9aa93dbe58a0256b9a627b91b8cb3cb7448 /src/nvim/path.c
parente4975f82c9704aa5d52e18e578a449268654ee37 (diff)
parent1e767ad96fca7d64b2edcdd76337c7f2545475ef (diff)
downloadrneovim-ecc28fb2dd43551f349a071f9597cf7033f306f7.tar.gz
rneovim-ecc28fb2dd43551f349a071f9597cf7033f306f7.tar.bz2
rneovim-ecc28fb2dd43551f349a071f9597cf7033f306f7.zip
Merge pull request #2117 from justinmk/fix1836
memline: fix segfaults
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r--src/nvim/path.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c
index 9515205643..80f1947ccf 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -83,15 +83,12 @@ FileComparison path_full_compare(char_u *s1, char_u *s2, int checkname)
return kDifferentFiles;
}
-/// Get the tail of a path: the file name.
+/// Gets the tail (i.e., the filename segment) of a path `fname`.
///
-/// @param fname A file path.
-/// @return
-/// - Empty string, if fname is NULL.
-/// - The position of the last path separator + 1. (i.e. empty string, if
-/// fname ends in a slash).
-/// - Never NULL.
+/// @return pointer just past the last path separator (empty string, if fname
+/// ends in a slash), or empty string if fname is NULL.
char_u *path_tail(char_u *fname)
+ FUNC_ATTR_NONNULL_RET
{
if (fname == NULL) {
return (char_u *)"";