aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/path.c
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-04-03 02:03:05 +0300
committerZyX <kp-pav@yandex.ru>2017-04-03 02:03:05 +0300
commit5dcf2804455f45eac8aad7d900bf60464a4b2888 (patch)
treea96301ec0356c126da4daf11173e191d295adfd8 /src/nvim/path.c
parent1c41b9c77552618a5010ca69bee92033c4082748 (diff)
downloadrneovim-5dcf2804455f45eac8aad7d900bf60464a4b2888.tar.gz
rneovim-5dcf2804455f45eac8aad7d900bf60464a4b2888.tar.bz2
rneovim-5dcf2804455f45eac8aad7d900bf60464a4b2888.zip
fileio: Refactor msg_add_fname to something which needs no comments
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r--src/nvim/path.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c
index d0248690d9..6bf42ed2fa 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -84,15 +84,15 @@ FileComparison path_full_compare(char_u *s1, char_u *s2, int checkname)
///
/// @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)
+char_u *path_tail(const char_u *fname)
FUNC_ATTR_NONNULL_RET
{
if (fname == NULL) {
return (char_u *)"";
}
- char_u *tail = get_past_head(fname);
- char_u *p = tail;
+ const char_u *tail = get_past_head(fname);
+ const char_u *p = tail;
// Find last part of path.
while (*p != NUL) {
if (vim_ispathsep_nocolon(*p)) {
@@ -100,7 +100,7 @@ char_u *path_tail(char_u *fname)
}
mb_ptr_adv(p);
}
- return tail;
+ return (char_u *)tail;
}
/// Get pointer to tail of "fname", including path separators.
@@ -174,9 +174,9 @@ const char *path_next_component(const char *fname)
/// Get a pointer to one character past the head of a path name.
/// Unix: after "/"; Win: after "c:\"
/// If there is no head, path is returned.
-char_u *get_past_head(char_u *path)
+char_u *get_past_head(const char_u *path)
{
- char_u *retval = path;
+ const char_u *retval = path;
#ifdef WIN32
// May skip "c:"
@@ -189,7 +189,7 @@ char_u *get_past_head(char_u *path)
++retval;
}
- return retval;
+ return (char_u *)retval;
}
/*