mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-21 01:12:26 +08:00
(internal_fnmatch): Correctly reset string pointer in case of an invalid [[: expression.
This commit is contained in:
parent
8a495c0922
commit
c0e18e5ed0
@ -130,7 +130,9 @@ extern int errno;
|
||||
/* Match STRING against the filename pattern PATTERN, returning zero if
|
||||
it matches, nonzero if not. */
|
||||
static int
|
||||
#ifdef _LIBC
|
||||
internal_function
|
||||
#endif
|
||||
internal_fnmatch (const char *pattern, const char *string,
|
||||
int no_leading_period, int flags)
|
||||
{
|
||||
@ -295,6 +297,7 @@ internal_fnmatch (const char *pattern, const char *string,
|
||||
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||
wctype_t wt;
|
||||
# endif
|
||||
char *startp = p;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@ -313,7 +316,7 @@ internal_fnmatch (const char *pattern, const char *string,
|
||||
{
|
||||
/* This cannot possibly be a character class name.
|
||||
Match it as a normal range. */
|
||||
--p;
|
||||
p = startp;
|
||||
c = '[';
|
||||
goto normal_bracket;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user