projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mkstemp: Move AC_LIBOBJ invocations to module description.
[pspp]
/
lib
/
fnmatch_loop.c
diff --git
a/lib/fnmatch_loop.c
b/lib/fnmatch_loop.c
index bb24904ded0ad6c4b9e30d127b9bb556b0d28c25..8334491d4037fc12dc31e244af1f6be989320dfd 100644
(file)
--- a/
lib/fnmatch_loop.c
+++ b/
lib/fnmatch_loop.c
@@
-1,5
+1,4
@@
-/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1993, 1996-2006, 2009-2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
@@
-201,6
+200,8
@@
FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
case L_('['):
{
/* Nonzero if the sense of the character class is inverted. */
case L_('['):
{
/* Nonzero if the sense of the character class is inverted. */
+ const CHAR *p_init = p;
+ const CHAR *n_init = n;
register bool not;
CHAR cold;
UCHAR fn;
register bool not;
CHAR cold;
UCHAR fn;
@@
-382,15
+383,20
@@
FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
/* We found a table entry. Now see whether the
character we are currently at has the same
equivalance class value. */
/* We found a table entry. Now see whether the
character we are currently at has the same
equivalance class value. */
- int len = weights[idx];
+ int len = weights[idx
& 0xffffff
];
int32_t idx2;
const UCHAR *np = (const UCHAR *) n;
idx2 = findidx (&np);
int32_t idx2;
const UCHAR *np = (const UCHAR *) n;
idx2 = findidx (&np);
- if (idx2 != 0 && len == weights[idx2])
+ if (idx2 != 0
+ && (idx >> 24) == (idx2 >> 24)
+ && len == weights[idx2 & 0xffffff])
{
int cnt = 0;
{
int cnt = 0;
+ idx &= 0xffffff;
+ idx2 &= 0xffffff;
+
while (cnt < len
&& (weights[idx + 1 + cnt]
== weights[idx2 + 1 + cnt]))
while (cnt < len
&& (weights[idx + 1 + cnt]
== weights[idx2 + 1 + cnt]))
@@
-406,8
+412,13
@@
FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
}
#endif
else if (c == L_('\0'))
}
#endif
else if (c == L_('\0'))
- /* [ (unterminated) loses. */
- return FNM_NOMATCH;
+ {
+ /* [ unterminated, treat as normal character. */
+ p = p_init;
+ n = n_init;
+ c = L_('[');
+ goto normal_match;
+ }
else
{
bool is_range = false;
else
{
bool is_range = false;