forked from aniani/vim
patch 9.1.1009: diff feature can be improved
Problem: diff feature can be improved Solution: include the linematch diff alignment algorithm (Jonathon) closes: #9661 Signed-off-by: Jonathon <jonathonwhite@protonmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
faf250c9e4
commit
7c7a4e6d1a
@@ -674,6 +674,22 @@ vim_strchr(char_u *string, int c)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Sized version of strchr that can handle embedded NULs.
|
||||
// Adjusts n to the new size.
|
||||
char *
|
||||
vim_strnchr(const char *p, size_t *n, int c)
|
||||
{
|
||||
while (*n > 0)
|
||||
{
|
||||
if (*p == c)
|
||||
return (char *)p;
|
||||
p++;
|
||||
(*n)--;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Version of strchr() that only works for bytes and handles unsigned char
|
||||
* strings with characters above 128 correctly. It also doesn't return a
|
||||
|
Reference in New Issue
Block a user