diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-04-03 03:54:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-03 03:54:34 +0200 |
commit | 6afa7d66cd6343c7c0114e6b3e08c592e169df43 (patch) | |
tree | b9bf75bedadd6a00347cd9f4396d159562fb7675 /src/nvim/path.c | |
parent | ddfa0359c638a4fd5eba5c339dc3e18e2b8aca35 (diff) | |
parent | ae7d8d8ffb86eefa45d8f59834eb0f088e93535d (diff) | |
download | rneovim-6afa7d66cd6343c7c0114e6b3e08c592e169df43.tar.gz rneovim-6afa7d66cd6343c7c0114e6b3e08c592e169df43.tar.bz2 rneovim-6afa7d66cd6343c7c0114e6b3e08c592e169df43.zip |
Merge #6427 from ZyX-I/writefile-allow-omitting-fsync
eval: Make writefile() able to disable fsync()
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r-- | src/nvim/path.c | 14 |
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; } /* |