mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-01 15:30:14 +00:00
Update.
1998-07-22 23:47 Ulrich Drepper <drepper@cygnus.com> * posix/fnmatch.c: Fix completely broken range matching.
This commit is contained in:
parent
e3efc21596
commit
6905087315
@ -1,3 +1,7 @@
|
|||||||
|
1998-07-22 23:47 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
|
* posix/fnmatch.c: Fix completely broken range matching.
|
||||||
|
|
||||||
1998-07-22 23:19 Ulrich Drepper <drepper@cygnus.com>
|
1998-07-22 23:19 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/bits/siginfo.h: Fix typo.
|
* sysdeps/unix/sysv/linux/bits/siginfo.h: Fix typo.
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
# include <strings.h>
|
# include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef STDC_HEADERS
|
#if defined STDC_HEADERS || defined _LIBC
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -216,6 +216,7 @@ fnmatch (pattern, string, flags)
|
|||||||
/* Nonzero if the sense of the character class is inverted. */
|
/* Nonzero if the sense of the character class is inverted. */
|
||||||
static int posixly_correct;
|
static int posixly_correct;
|
||||||
register int not;
|
register int not;
|
||||||
|
char cold;
|
||||||
|
|
||||||
if (posixly_correct == 0)
|
if (posixly_correct == 0)
|
||||||
posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
|
posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
|
||||||
@ -245,6 +246,9 @@ fnmatch (pattern, string, flags)
|
|||||||
if (c == fn)
|
if (c == fn)
|
||||||
goto matched;
|
goto matched;
|
||||||
}
|
}
|
||||||
|
else if ((flags & FNM_FILE_NAME) && c == '/')
|
||||||
|
/* [/] can never match. */
|
||||||
|
return FNM_NOMATCH;
|
||||||
else if (c == '[' && *p == ':')
|
else if (c == '[' && *p == ':')
|
||||||
{
|
{
|
||||||
/* Leave room for the null. */
|
/* Leave room for the null. */
|
||||||
@ -301,8 +305,23 @@ fnmatch (pattern, string, flags)
|
|||||||
else if (FOLD (c) == fn)
|
else if (FOLD (c) == fn)
|
||||||
goto matched;
|
goto matched;
|
||||||
|
|
||||||
|
cold = c;
|
||||||
c = *p++;
|
c = *p++;
|
||||||
|
|
||||||
|
if (c == '-' && *p != ']')
|
||||||
|
{
|
||||||
|
/* It is a range. */
|
||||||
|
char cend = *p++;
|
||||||
|
if (!(flags & FNM_NOESCAPE) && cend == '\\')
|
||||||
|
cend = *p++;
|
||||||
|
if (cend == '\0')
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
if (cold <= fn && fn <= FOLD (cend))
|
||||||
|
goto matched;
|
||||||
|
|
||||||
|
c = *p++;
|
||||||
|
}
|
||||||
if (c == ']')
|
if (c == ']')
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user