diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-09-10 14:33:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-10 14:33:43 +0200 |
commit | 4638fcf4fb688fa548b8ce337ec3b7c1327fbfe9 (patch) | |
tree | b62862e24e506e0010852d23b68c79103637500c /src/nvim/eval.c | |
parent | 40f9f479b746d0f76fbdd4bc0567d593ca7a6070 (diff) | |
parent | 684bc749efef0fa31395d349f4495d79ec5f3fd5 (diff) | |
download | rneovim-4638fcf4fb688fa548b8ce337ec3b7c1327fbfe9.tar.gz rneovim-4638fcf4fb688fa548b8ce337ec3b7c1327fbfe9.tar.bz2 rneovim-4638fcf4fb688fa548b8ce337ec3b7c1327fbfe9.zip |
Merge pull request #20068 from dundargoc/refactor/char_u/10
refactor: replace char_u with char 10: remove `FNAMECMP`, `FNAMENCMP` and `STRLCAT`
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 0f2547120d..ead01fcbad 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -8117,7 +8117,7 @@ repeat: // Do not call shorten_fname() here since it removes the prefix // even though the path does not have a prefix. - if (FNAMENCMP(p, dirname, namelen) == 0) { + if (path_fnamencmp(p, dirname, namelen) == 0) { p += namelen; if (vim_ispathsep(*p)) { while (*p && vim_ispathsep(*p)) { @@ -8329,7 +8329,7 @@ char *do_string_sub(char *str, char *pat, char *sub, typval_T *expr, char *flags while (vim_regexec_nl(®match, (char_u *)str, (colnr_T)(tail - str))) { // Skip empty match except for first match. if (regmatch.startp[0] == regmatch.endp[0]) { - if ((char_u *)zero_width == regmatch.startp[0]) { + if (zero_width == regmatch.startp[0]) { // avoid getting stuck on a match with an empty string int i = utfc_ptr2len(tail); memmove((char_u *)ga.ga_data + ga.ga_len, tail, (size_t)i); @@ -8337,7 +8337,7 @@ char *do_string_sub(char *str, char *pat, char *sub, typval_T *expr, char *flags tail += i; continue; } - zero_width = (char *)regmatch.startp[0]; + zero_width = regmatch.startp[0]; } // Get some space for a temporary buffer to do the substitution @@ -8350,14 +8350,14 @@ char *do_string_sub(char *str, char *pat, char *sub, typval_T *expr, char *flags (regmatch.endp[0] - regmatch.startp[0]))); // copy the text up to where the match is - int i = (int)(regmatch.startp[0] - (char_u *)tail); + int i = (int)(regmatch.startp[0] - tail); memmove((char_u *)ga.ga_data + ga.ga_len, tail, (size_t)i); // add the substituted text (void)vim_regsub(®match, (char_u *)sub, expr, (char_u *)ga.ga_data + ga.ga_len + i, sublen, REGSUB_COPY | REGSUB_MAGIC); ga.ga_len += i + sublen - 1; - tail = (char *)regmatch.endp[0]; + tail = regmatch.endp[0]; if (*tail == NUL) { break; } |