mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 22:08:18 +00:00
@@ -425,24 +425,6 @@ char_u *vim_strchr(const char_u *const string, const int c)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Version of strchr() that only works for bytes and handles unsigned char
|
||||
* strings with characters above 128 correctly. It also doesn't return a
|
||||
* pointer to the NUL at the end of the string.
|
||||
*/
|
||||
char_u *vim_strbyte(const char_u *string, int c)
|
||||
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE
|
||||
{
|
||||
const char_u *p = string;
|
||||
|
||||
while (*p != NUL) {
|
||||
if (*p == c)
|
||||
return (char_u *) p;
|
||||
++p;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Search for last occurrence of "c" in "string".
|
||||
* Return NULL if not found.
|
||||
|
Reference in New Issue
Block a user