compat/fnmatch: fix off-by-one character class's length check
Character class "xdigit" is the only one that hits 6 character limit defined by CHAR_CLASS_MAX_LENGTH. All other character classes are 5 character long and therefore never caught by this. This should make xdigit tests in t3070 pass on Windows. Reported-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
7e2010537e
commit
f10e3864dc
@ -345,7 +345,7 @@ internal_fnmatch (pattern, string, no_leading_period, flags)
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (c1 == CHAR_CLASS_MAX_LENGTH)
|
||||
if (c1 > CHAR_CLASS_MAX_LENGTH)
|
||||
/* The name is too long and therefore the pattern
|
||||
is ill-formed. */
|
||||
return FNM_NOMATCH;
|
||||
|
Loading…
Reference in New Issue
Block a user