1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Guido van Rossum. 7 * 8 * Copyright (c) 2011 The FreeBSD Foundation --- 25 unchanged lines hidden (view full) --- 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 */ 37 38#if defined(LIBC_SCCS) && !defined(lint) 39static char sccsid[] = "@(#)glob.c 8.3 (Berkeley) 10/13/93"; 40#endif /* LIBC_SCCS and not lint */ 41#include <sys/cdefs.h> |
42__FBSDID("$FreeBSD: head/lib/libc/gen/glob.c 301461 2016-06-05 19:12:52Z pfg $"); |
43 44/* 45 * glob(3) -- a superset of the one defined in POSIX 1003.2. 46 * 47 * The [!...] convention to negate a range is supported (SysV, Posix, ksh). 48 * 49 * Optional extra services, controlled by flags not defined by POSIX: 50 * --- 776 unchanged lines hidden (view full) --- 827 if ((k = *name++) == EOS) 828 return (0); 829 if ((negate_range = ((*pat & M_MASK) == M_NOT)) != EOS) 830 ++pat; 831 while (((c = *pat++) & M_MASK) != M_END) 832 if ((*pat & M_MASK) == M_RNG) { 833 if (table->__collate_load_error ? 834 CHAR(c) <= CHAR(k) && CHAR(k) <= CHAR(pat[1]) : |
835 __wcollate_range_cmp(table, CHAR(c), CHAR(k)) <= 0 836 && __wcollate_range_cmp(table, CHAR(k), CHAR(pat[1])) <= 0 |
837 ) 838 ok = 1; 839 pat += 2; 840 } else if (c == k) 841 ok = 1; 842 if (ok == negate_range) 843 return (0); 844 break; --- 121 unchanged lines hidden --- |