diff options
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r-- | src/nvim/path.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c index 5b1793b111..1085f7a10c 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -359,8 +359,8 @@ int path_fnamencmp(const char *const fname1, const char *const fname2, size_t le const char *p1 = fname1; const char *p2 = fname2; while (len > 0) { - c1 = PTR2CHAR((const char_u *)p1); - c2 = PTR2CHAR((const char_u *)p2); + c1 = utf_ptr2char((const char_u *)p1); + c2 = utf_ptr2char((const char_u *)p2); if ((c1 == NUL || c2 == NUL || (!((c1 == '/' || c1 == '\\') && (c2 == '\\' || c2 == '/')))) && (p_fic ? (c1 != c2 && CH_FOLD(c1) != CH_FOLD(c2)) : c1 != c2)) { @@ -631,7 +631,7 @@ static size_t do_path_expand(garray_T *gap, const char_u *path, size_t wildoff, && (vim_strchr((char_u *)"*?[{~$", *path_end) != NULL #ifndef WIN32 || (!p_fic && (flags & EW_ICASE) - && isalpha(PTR2CHAR(path_end))) + && isalpha(utf_ptr2char(path_end))) #endif )) { e = p; @@ -1011,8 +1011,7 @@ static void uniquefy_paths(garray_T *gap, char_u *pattern) // /file.txt / /file.txt // c:\file.txt c:\ .\file.txt short_name = path_shorten_fname(path, curdir); - if (short_name != NULL && short_name > path + 1 - ) { + if (short_name != NULL && short_name > path + 1) { STRCPY(path, "."); add_pathsep((char *)path); STRMOVE(path + STRLEN(path), short_name); @@ -1506,8 +1505,9 @@ void simplify_filename(char_u *filename) if (vim_ispathsep(*p)) { relative = false; - do + do{ ++p; + } while (vim_ispathsep(*p)); } start = p; // remember start after "c:/" or "/" or "///" @@ -1701,7 +1701,7 @@ char_u *find_file_name_in_path(char_u *ptr, size_t len, int options, long count, if (file_name == NULL && (options & FNAME_MESS)) { char_u c = ptr[len]; ptr[len] = NUL; - EMSG2(_("E447: Can't find file \"%s\" in path"), ptr); + semsg(_("E447: Can't find file \"%s\" in path"), ptr); ptr[len] = c; } @@ -1937,8 +1937,8 @@ int pathcmp(const char *p, const char *q, int maxlen) const char *s = NULL; for (i = 0, j = 0; maxlen < 0 || (i < maxlen && j < maxlen);) { - c1 = PTR2CHAR((char_u *)p + i); - c2 = PTR2CHAR((char_u *)q + j); + c1 = utf_ptr2char((char_u *)p + i); + c2 = utf_ptr2char((char_u *)q + j); // End of "p": check if "q" also ends or just has a slash. if (c1 == NUL) { @@ -1980,8 +1980,8 @@ int pathcmp(const char *p, const char *q, int maxlen) return 0; } - c1 = PTR2CHAR((char_u *)s + i); - c2 = PTR2CHAR((char_u *)s + i + utfc_ptr2len((char_u *)s + i)); + c1 = utf_ptr2char((char_u *)s + i); + c2 = utf_ptr2char((char_u *)s + i + utfc_ptr2len((char_u *)s + i)); // ignore a trailing slash, but not "//" or ":/" if (c2 == NUL && i > 0 @@ -2081,7 +2081,7 @@ int expand_wildcards_eval(char_u **pat, int *num_file, char_u ***file, int flags int ret = FAIL; char_u *eval_pat = NULL; char_u *exp_pat = *pat; - char_u *ignored_msg; + char *ignored_msg; size_t usedlen; if (*exp_pat == '%' || *exp_pat == '#' || *exp_pat == '<') { @@ -2257,7 +2257,7 @@ int path_full_dir_name(char *directory, char *buffer, size_t len) if (os_chdir(old_dir) != SUCCESS) { // That shouldn't happen, since we've tested if it works. retval = FAIL; - EMSG(_(e_prev_dir)); + emsg(_(e_prev_dir)); } return retval; |