diff src/filepath.c @ 18251:c8a53c0daeed v8.1.2120

patch 8.1.2120: some MB_ macros are more complicated than necessary Commit: https://github.com/vim/vim/commit/1614a14901558ca091329315d14a7d5e1b53aa47 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Oct 6 22:00:13 2019 +0200 patch 8.1.2120: some MB_ macros are more complicated than necessary Problem: Some MB_ macros are more complicated than necessary. (Dominique Pelle) Solution: Simplify the macros. Expand inline.
author Bram Moolenaar <Bram@vim.org>
date Sun, 06 Oct 2019 22:15:04 +0200
parents d1e77015f60b
children 8d09b7f53c71
line wrap: on
line diff
--- a/src/filepath.c
+++ b/src/filepath.c
@@ -2613,9 +2613,9 @@ vim_fnamencmp(char_u *x, char_u *y, size
 		&& !(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, in
 		    : 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