diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-08-29 18:46:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-29 18:46:38 +0200 |
commit | 68efac36831fca40c0a15365d0f0fc2d38c43708 (patch) | |
tree | 8494afd25e715b063f7a802584a007a8c62be53e /src/nvim/regexp.c | |
parent | 126fe7fbc9c88c412c8067d9d146d998baf6dd47 (diff) | |
parent | 58f30a326f34319801e7921f32c83e8320d85f6c (diff) | |
download | rneovim-68efac36831fca40c0a15365d0f0fc2d38c43708.tar.gz rneovim-68efac36831fca40c0a15365d0f0fc2d38c43708.tar.bz2 rneovim-68efac36831fca40c0a15365d0f0fc2d38c43708.zip |
Merge pull request #19973 from dundargoc/refactor/char_u/3
refactor: replace char_u with char 3: revenge of the unsigned
Diffstat (limited to 'src/nvim/regexp.c')
-rw-r--r-- | src/nvim/regexp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 75bd7b4cc1..a52343e28b 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -488,10 +488,10 @@ static char_u *skip_anyof(char *p) /// When "newp" is not NULL and "dirc" is '?', make an allocated copy of the /// expression and change "\?" to "?". If "*newp" is not NULL the expression /// is changed in-place. -char_u *skip_regexp(char_u *startp, int dirc, int magic, char **newp) +char *skip_regexp(char *startp, int dirc, int magic, char **newp) { int mymagic; - char_u *p = startp; + char *p = startp; if (magic) { mymagic = MAGIC_ON; @@ -506,7 +506,7 @@ char_u *skip_regexp(char_u *startp, int dirc, int magic, char **newp) } if ((p[0] == '[' && mymagic >= MAGIC_ON) || (p[0] == '\\' && p[1] == '[' && mymagic <= MAGIC_OFF)) { - p = skip_anyof((char *)p + 1); + p = (char *)skip_anyof(p + 1); if (p[0] == NUL) { break; } @@ -514,8 +514,8 @@ char_u *skip_regexp(char_u *startp, int dirc, int magic, char **newp) if (dirc == '?' && newp != NULL && p[1] == '?') { // change "\?" to "?", make a copy first. if (*newp == NULL) { - *newp = (char *)vim_strsave(startp); - p = (char_u *)(*newp) + (p - startp); + *newp = xstrdup(startp); + p = *newp + (p - startp); } STRMOVE(p, p + 1); } else { |