提交 f10e3864 编写于 作者: N Nguyễn Thái Ngọc Duy 提交者: Junio C Hamano

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: NJohannes Sixt <j6t@kdbg.org>
Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 7e201053
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册