diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-10-06 22:00:13 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-10-06 22:00:13 +0200 |
commit | 1614a14901558ca091329315d14a7d5e1b53aa47 (patch) | |
tree | 324ceeba0f8d5bda2f270b591a1beeed8e74125d /src/filepath.c | |
parent | 524f3b19ae16e08350010b5effe38d0637349285 (diff) | |
download | vim-git-1614a14901558ca091329315d14a7d5e1b53aa47.tar.gz |
patch 8.1.2120: some MB_ macros are more complicated than necessaryv8.1.2120
Problem: Some MB_ macros are more complicated than necessary. (Dominique
Pelle)
Solution: Simplify the macros. Expand inline.
Diffstat (limited to 'src/filepath.c')
-rw-r--r-- | src/filepath.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/filepath.c b/src/filepath.c index 5ffb8c9b4..3a06eec7b 100644 --- a/src/filepath.c +++ b/src/filepath.c @@ -2613,9 +2613,9 @@ vim_fnamencmp(char_u *x, char_u *y, size_t len) && !(cx == '/' && cy == '\\') && !(cx == '\\' && cy == '/'))) break; - len -= MB_PTR2LEN(px); - px += MB_PTR2LEN(px); - py += MB_PTR2LEN(py); + len -= mb_ptr2len(px); + px += mb_ptr2len(px); + py += mb_ptr2len(py); } if (len == 0) return 0; @@ -3769,14 +3769,14 @@ pathcmp(const char *p, const char *q, int maxlen) : c1 - c2; // no match } - i += MB_PTR2LEN((char_u *)p + i); - j += MB_PTR2LEN((char_u *)q + j); + i += mb_ptr2len((char_u *)p + i); + j += mb_ptr2len((char_u *)q + j); } if (s == NULL) // "i" or "j" ran into "maxlen" return 0; c1 = PTR2CHAR((char_u *)s + i); - c2 = PTR2CHAR((char_u *)s + i + MB_PTR2LEN((char_u *)s + i)); + c2 = PTR2CHAR((char_u *)s + i + mb_ptr2len((char_u *)s + i)); // ignore a trailing slash, but not "//" or ":/" if (c2 == NUL && i > 0 |