refactor: replace char_u with char 16 - remove STRNCMP (#21208)

refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
This commit is contained in:
dundargoc
2022-12-21 12:00:05 +01:00
committed by GitHub
parent c24605a5a0
commit ec1738a6ed
26 changed files with 533 additions and 533 deletions

View File

@@ -2960,7 +2960,7 @@ int wildmenu_process_key(CmdlineInfo *cclp, int key, expand_T *xp)
if (xp->xp_context == EXPAND_FILES
|| xp->xp_context == EXPAND_DIRECTORIES
|| xp->xp_context == EXPAND_SHELLCMD) {
char_u upseg[5];
char upseg[5];
upseg[0] = PATHSEP;
upseg[1] = '.';
@@ -2977,7 +2977,7 @@ int wildmenu_process_key(CmdlineInfo *cclp, int key, expand_T *xp)
// go down a directory
c = (int)p_wc;
KeyTyped = true; // in case the key was mapped
} else if (STRNCMP(xp->xp_pattern, upseg + 1, 3) == 0
} else if (strncmp(xp->xp_pattern, upseg + 1, 3) == 0
&& c == K_DOWN) {
// If in a direct ancestor, strip off one ../ to go down
int found = false;
@@ -3024,9 +3024,9 @@ int wildmenu_process_key(CmdlineInfo *cclp, int key, expand_T *xp)
if (!found) {
j = i;
} else if (STRNCMP(cclp->cmdbuff + j, upseg, 4) == 0) {
} else if (strncmp(cclp->cmdbuff + j, upseg, 4) == 0) {
j += 4;
} else if (STRNCMP(cclp->cmdbuff + j, upseg + 1, 3) == 0
} else if (strncmp(cclp->cmdbuff + j, upseg + 1, 3) == 0
&& j == i) {
j += 3;
} else {
@@ -3037,7 +3037,7 @@ int wildmenu_process_key(CmdlineInfo *cclp, int key, expand_T *xp)
// TODO(tarruda): this is only for DOS/Unix systems - need to put in
// machine-specific stuff here and in upseg init
cmdline_del(cclp, j);
put_on_cmdline(upseg + 1, 3, false);
put_on_cmdline((char_u *)upseg + 1, 3, false);
} else if (cclp->cmdpos > i) {
cmdline_del(cclp, i);
}