diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-05-08 13:45:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-08 13:45:14 +0200 |
commit | a9605bb4aff76a934a4c39fbda093ee8fc8a1c71 (patch) | |
tree | 47dbb30254735b7184442eb9ab290659259b9635 /src/nvim/ex_cmds.c | |
parent | 631d55ada04bfeaedabb5bf43092457c5f78b8a5 (diff) | |
parent | 22fb9d8d25f5354bb878b953ba49b439961c8476 (diff) | |
download | rneovim-a9605bb4aff76a934a4c39fbda093ee8fc8a1c71.tar.gz rneovim-a9605bb4aff76a934a4c39fbda093ee8fc8a1c71.tar.bz2 rneovim-a9605bb4aff76a934a4c39fbda093ee8fc8a1c71.zip |
Merge #6460 from ZyX-I/1476-changes
Refactor functions which find character in a string
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index f73d4c16b6..018a228843 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -5101,14 +5101,13 @@ static void helptags_one(char_u *dir, char_u *ext, char_u *tagfname, } p1 = vim_strchr(IObuff, '*'); /* find first '*' */ while (p1 != NULL) { - /* Use vim_strbyte() instead of vim_strchr() so that when - * 'encoding' is dbcs it still works, don't find '*' in the - * second byte. */ - p2 = vim_strbyte(p1 + 1, '*'); /* find second '*' */ - if (p2 != NULL && p2 > p1 + 1) { /* skip "*" and "**" */ - for (s = p1 + 1; s < p2; ++s) - if (*s == ' ' || *s == '\t' || *s == '|') + p2 = (char_u *)strchr((const char *)p1 + 1, '*'); // Find second '*'. + if (p2 != NULL && p2 > p1 + 1) { // Skip "*" and "**". + for (s = p1 + 1; s < p2; s++) { + if (*s == ' ' || *s == '\t' || *s == '|') { break; + } + } /* * Only accept a *tag* when it consists of valid |