diff options
author | Thomas Wienecke <wienecke.t@gmail.com> | 2014-03-30 20:06:04 +0200 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-04-03 10:32:41 -0300 |
commit | 955d6a29496d9f7902e95f4a2cc01fedd56e4a21 (patch) | |
tree | a4f66e7d0572840487e898ebe93df2315bb3ec2c /src/path.c | |
parent | 7021b970b9e8b3f9b9fe71546bfb3aa30851abd2 (diff) | |
download | rneovim-955d6a29496d9f7902e95f4a2cc01fedd56e4a21.tar.gz rneovim-955d6a29496d9f7902e95f4a2cc01fedd56e4a21.tar.bz2 rneovim-955d6a29496d9f7902e95f4a2cc01fedd56e4a21.zip |
Test and refactor getnextcomp -> path_next_component.
Diffstat (limited to 'src/path.c')
-rw-r--r-- | src/path.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/path.c b/src/path.c index c01b1b9fa2..93ee6dddeb 100644 --- a/src/path.c +++ b/src/path.c @@ -93,15 +93,15 @@ char_u *path_tail_with_seperator(char_u *fname) return tail; } -/* - * get the next path component (just after the next path separator). - */ -char_u *getnextcomp(char_u *fname) +char_u *path_next_component(char_u *fname) { - while (*fname && !vim_ispathsep(*fname)) + assert(fname != NULL); + while (*fname != NUL && !vim_ispathsep(*fname)) { mb_ptr_adv(fname); - if (*fname) + } + if (*fname != NUL) { ++fname; + } return fname; } @@ -1428,7 +1428,7 @@ void simplify_filename(char_u *filename) } } else { ++components; /* simple path component */ - p = getnextcomp(p); + p = path_next_component(p); } } while (*p != NUL); } |