Merge #6460 from ZyX-I/1476-changes

Refactor functions which find character in a string
This commit is contained in:
Justin M. Keyes
2017-05-08 13:45:14 +02:00
committed by GitHub
6 changed files with 71 additions and 142 deletions

View File

@@ -359,10 +359,10 @@ int bomb_size(void)
*/
void remove_bom(char_u *s)
{
char_u *p = s;
char *p = (char *)s;
while ((p = vim_strbyte(p, 0xef)) != NULL) {
if (p[1] == 0xbb && p[2] == 0xbf) {
while ((p = strchr(p, 0xef)) != NULL) {
if ((uint8_t)p[1] == 0xbb && (uint8_t)p[2] == 0xbf) {
STRMOVE(p, p + 3);
} else {
p++;